{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Interpret Advanced Usage\n",
    "\n",
    "The `interpret` module provides a set of helper functions to aid the user in more advanced and complex analysis not covered within the `comparisons`, `predictions`, and `slopes` functions. These helper functions are `data_grid` and `select_draws`. The `data_grid` can be used to create a pairwise grid of data points for the user to pass to `model.predict`. Subsequently, `select_draws` is used to select the draws from the posterior (or posterior predictive) group of the InferenceData object returned by the predict method that correspond to the data points that \"produced\" that draw.\n",
    "\n",
    "With access to the appropriately indexed draws, and data used to generate those draws, it enables for more complex analysis such as cross-comparisons and the choice of which model parameter to compute a quantity of interest for; among others. Additionally, the user has more control over the data passed to `model.predict`. Below, it will be demonstrated how to use these helper functions. First, to reproduce the results from the standard `interpret` API, and then to compute cross-comparisons."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import warnings\n",
    "\n",
    "import arviz as az\n",
    "import numpy as np\n",
    "import pandas as pd\n",
    "\n",
    "import bambi as bmb\n",
    "\n",
    "from bambi.interpret.helpers import data_grid, select_draws\n",
    "\n",
    "warnings.simplefilter(action='ignore', category=FutureWarning)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Zero Inflated Poisson\n",
    "\n",
    "We will adopt the zero inflated Poisson (ZIP) model from the [comparisons](https://bambinos.github.io/bambi/notebooks/plot_comparisons.html)  documentation to demonstrate the helper functions introduced above. \n",
    "\n",
    "The ZIP model will be used to predict how many fish are caught by visitors at a state park using survey [data](https://stats.idre.ucla.edu/stat/data/fish.csv). Many visitors catch zero fish, either because they did not fish at all, or because they were unlucky. We would like to explicitly model this bimodal behavior (zero versus non-zero) using a Zero Inflated Poisson model, and to compare how different inputs of interest $w$ and other covariate values $c$ are associated with the number of fish caught. The dataset contains data on 250 groups that went to a state park to fish. Each group was questioned about how many fish they caught (`count`), how many children were in the group (`child`), how many people were in the group (`persons`), if they used a live bait and whether or not they brought a camper to the park (`camper`)."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "fish_data = pd.read_csv(\"https://stats.idre.ucla.edu/stat/data/fish.csv\")\n",
    "cols = [\"count\", \"livebait\", \"camper\", \"persons\", \"child\"]\n",
    "fish_data = fish_data[cols]\n",
    "fish_data[\"child\"] = fish_data[\"child\"].astype(np.int8)\n",
    "fish_data[\"persons\"] = fish_data[\"persons\"].astype(np.int8)\n",
    "fish_data[\"livebait\"] = pd.Categorical(fish_data[\"livebait\"])\n",
    "fish_data[\"camper\"] = pd.Categorical(fish_data[\"camper\"])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Initializing NUTS using jitter+adapt_diag...\n",
      "Multiprocess sampling (4 chains in 4 jobs)\n",
      "NUTS: [psi, Intercept, livebait, camper, persons, child]\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "7e3f1f8515684d25a717e121d941d2b9",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Output()"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"></pre>\n"
      ],
      "text/plain": []
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Sampling 4 chains for 1_000 tune and 1_000 draw iterations (4_000 + 4_000 draws total) took 6 seconds.\n"
     ]
    }
   ],
   "source": [
    "fish_model = bmb.Model(\n",
    "    \"count ~ livebait + camper + persons + child\", \n",
    "    fish_data, \n",
    "    family='zero_inflated_poisson'\n",
    ")\n",
    "\n",
    "fish_idata = fish_model.fit(random_seed=1234)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Create a grid of data\n",
    "\n",
    "`data_grid` allows you to create a pairwise grid, also known as a cross-join or cartesian product, of data using the covariates passed to the `conditional` and the optional `variable` parameter. Covariates not passed to `conditional`, but are terms in the Bambi model, are set to typical values (e.g., mean or mode). If you are coming from R, this function is partially inspired from the [data_grid](https://modelr.tidyverse.org/reference/data_grid.html) function in the R package [modelr](https://modelr.tidyverse.org/index.html). \n",
    "\n",
    "There are two ways to create a pairwise grid of data:\n",
    "\n",
    "1. user-provided values are passed as a dictionary to `conditional` where the keys are the names of the covariates and the values are the values to use in the grid.\n",
    "2. a list of covariates where the elements are the names of the covariates to use in the grid. As only the names of the covariates were passed, default values are computed to construct the grid.\n",
    "\n",
    "Any unspecified covariates, i.e., covariates not passed to `conditional` but are terms in the Bambi model, are set to their \"typical\" values such as mean or mode depending on the data type of the covariate."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### User-provided values\n",
    "\n",
    "To construct a pairwise grid of data for specific covariate values, pass a dictionary to `conditional`. The values of the dictionary can be of type `int`, `float`, `list`, or `np.ndarray`."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Default computed for unspecified variable: livebait\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>camper</th>\n",
       "      <th>persons</th>\n",
       "      <th>child</th>\n",
       "      <th>livebait</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>0</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>0</td>\n",
       "      <td>4</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>0</td>\n",
       "      <td>4</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   camper  persons  child livebait\n",
       "0       0        1      1        1\n",
       "1       0        1      2        1\n",
       "2       0        1      3        1\n",
       "3       0        2      1        1\n",
       "4       0        2      2        1\n",
       "5       0        2      3        1\n",
       "6       0        3      1        1\n",
       "7       0        3      2        1\n",
       "8       0        3      3        1\n",
       "9       0        4      1        1\n",
       "10      0        4      2        1\n",
       "11      0        4      3        1"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "conditional = {\n",
    "    \"camper\": np.array([0, 1]),\n",
    "    \"persons\": np.arange(1, 5, 1),\n",
    "    \"child\": np.array([1, 2, 3]),\n",
    "}\n",
    "user_passed_grid = data_grid(fish_model, conditional)\n",
    "user_passed_grid.query(\"camper == 0\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Subsetting by `camper = 0`, it can be seen that a combination of all possible pairs of values from the dictionary (including the unspecified variable `livebait`) results in a dataframe containing every possible combination of values from the original sets. `livebait` has been set to 1 as this is the mode of the unspecified categorical variable."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Default values\n",
    "\n",
    "Alternatively, a list of covariates can be passed to `conditional` where the elements are the names of the covariates to use in the grid. By doing this, you are telling `interpret` to compute default values for these covariates. The psuedocode below outlines the logic and functions used to compute these default values:\n",
    "\n",
    "```python\n",
    "if is_numeric_dtype(x) or is_float_dtype(x):\n",
    "    values = np.linspace(np.min(x), np.max(x), 50)\n",
    "\n",
    "elif is_integer_dtype(x):\n",
    "    values = np.quantile(x, np.linspace(0, 1, 5))\n",
    "\n",
    "elif is_categorical_dtype(x) or is_string_dtype(x) or is_object_dtype(x):\n",
    "    values = np.unique(x)\n",
    "```"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Default computed for conditional variable: camper, persons, child\n",
      "Default computed for unspecified variable: livebait\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "((32, 4), (24, 4))"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "conditional = [\"camper\", \"persons\", \"child\"]\n",
    "default_grid = data_grid(fish_model, conditional)\n",
    "\n",
    "default_grid.shape, user_passed_grid.shape"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Notice how the resulting length is different between the user passed and default grid. This is due to the fact that values for `child` range from 0 to 3 for the default grid."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>camper</th>\n",
       "      <th>persons</th>\n",
       "      <th>child</th>\n",
       "      <th>livebait</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>0</td>\n",
       "      <td>4</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>0</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>0</td>\n",
       "      <td>4</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>0</td>\n",
       "      <td>4</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   camper  persons  child livebait\n",
       "0       0        1      0        1\n",
       "1       0        1      1        1\n",
       "2       0        1      2        1\n",
       "3       0        1      3        1\n",
       "4       0        2      0        1\n",
       "5       0        2      1        1\n",
       "6       0        2      2        1\n",
       "7       0        2      3        1\n",
       "8       0        3      0        1\n",
       "9       0        3      1        1\n",
       "10      0        3      2        1\n",
       "11      0        3      3        1\n",
       "12      0        4      0        1\n",
       "13      0        4      1        1\n",
       "14      0        4      2        1\n",
       "15      0        4      3        1"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "default_grid.query(\"camper == 0\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Compute comparisons\n",
    "\n",
    "To use `data_grid` to help generate data in computing comparisons or slopes, additional data is passed to the optional `variable` parameter. The name `variable` is an abstraction for the comparisons parameter `contrast` and slopes parameter `wrt`. If you have used any of the `interpret` functions, these parameter names should be familiar and the use of `data_grid` should be analogous to `comparisons`, `predictions`, and `slopes`.\n",
    "\n",
    "`variable` can also be passed user-provided data (as a dictionary), or a string indicating the name of the covariate of interest. If the latter, a default value will be computed. Additionally, if an argument is passed for `variable`, then the `effect_type` needs to be passed. This is because for `comparisons` and `slopes` an epsilon value `eps` needs to be determined to compute the centered and finite difference, respectively. You can also pass a value for `eps` as a kwarg."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Default computed for contrast variable: livebait\n"
     ]
    }
   ],
   "source": [
    "conditional = {\n",
    "    \"camper\": np.array([0, 1]),\n",
    "    \"persons\": np.arange(1, 5, 1),\n",
    "    \"child\": np.array([1, 2, 3, 4])\n",
    "}\n",
    "variable = \"livebait\"\n",
    "\n",
    "grid = data_grid(fish_model, conditional, variable, effect_type=\"comparisons\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "idata_grid = fish_model.predict(fish_idata, data=grid, inplace=False)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Select draws conditional on data\n",
    "\n",
    "The second helper function to aid in more advanced analysis is `select_draws`. This is a function that selects the posterior or posterior predictive draws from the ArviZ [InferenceData](https://python.arviz.org/en/stable/getting_started/WorkingWithInferenceData.html) object returned by `model.predict` given a conditional dictionary. The conditional dictionary represents the values that correspond to that draw. \n",
    "\n",
    "For example, if we wanted to select posterior draws where `livebait = [0, 1]`, then all we need to do is pass a dictionary where the key is the name of the covariate and the value is the value that we want to condition on (or select). The resulting InferenceData object will contain the draws that correspond to the data points where `livebait = [0, 1]`. Additionally, you must pass the InferenceData object returned by `model.predict`, the data used to generate the predictions, and the name of the data variable `data_var` you would like to select from the InferenceData posterior group. If you specified to return the posterior predictive samples by passing `model.predict(..., kind=\"pps\")`, you can use this group instead of the posterior group by passing `group=\"posterior_predictive\"`.\n",
    "\n",
    "Below, it is demonstrated how to compute comparisons for `count_mean` for the contrast `livebait = [0, 1]` using the posterior draws."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "            <div>\n",
       "              <div class='xr-header'>\n",
       "                <div class=\"xr-obj-type\">arviz.InferenceData</div>\n",
       "              </div>\n",
       "              <ul class=\"xr-sections group-sections\">\n",
       "              \n",
       "            <li class = \"xr-section-item\">\n",
       "                  <input id=\"idata_posterioraafb8e22-e802-4402-a5ab-5734af772dbc\" class=\"xr-section-summary-in\" type=\"checkbox\">\n",
       "                  <label for=\"idata_posterioraafb8e22-e802-4402-a5ab-5734af772dbc\" class = \"xr-section-summary\">posterior</label>\n",
       "                  <div class=\"xr-section-inline-details\"></div>\n",
       "                  <div class=\"xr-section-details\">\n",
       "                      <ul id=\"xr-dataset-coord-list\" class=\"xr-var-list\">\n",
       "                          <div style=\"padding-left:2rem;\"><div><svg style=\"position: absolute; width: 0; height: 0; overflow: hidden\">\n",
       "<defs>\n",
       "<symbol id=\"icon-database\" viewBox=\"0 0 32 32\">\n",
       "<path d=\"M16 0c-8.837 0-16 2.239-16 5v4c0 2.761 7.163 5 16 5s16-2.239 16-5v-4c0-2.761-7.163-5-16-5z\"></path>\n",
       "<path d=\"M16 17c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
       "<path d=\"M16 26c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
       "</symbol>\n",
       "<symbol id=\"icon-file-text2\" viewBox=\"0 0 32 32\">\n",
       "<path d=\"M28.681 7.159c-0.694-0.947-1.662-2.053-2.724-3.116s-2.169-2.030-3.116-2.724c-1.612-1.182-2.393-1.319-2.841-1.319h-15.5c-1.378 0-2.5 1.121-2.5 2.5v27c0 1.378 1.122 2.5 2.5 2.5h23c1.378 0 2.5-1.122 2.5-2.5v-19.5c0-0.448-0.137-1.23-1.319-2.841zM24.543 5.457c0.959 0.959 1.712 1.825 2.268 2.543h-4.811v-4.811c0.718 0.556 1.584 1.309 2.543 2.268zM28 29.5c0 0.271-0.229 0.5-0.5 0.5h-23c-0.271 0-0.5-0.229-0.5-0.5v-27c0-0.271 0.229-0.5 0.5-0.5 0 0 15.499-0 15.5 0v7c0 0.552 0.448 1 1 1h7v19.5z\"></path>\n",
       "<path d=\"M23 26h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
       "<path d=\"M23 22h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
       "<path d=\"M23 18h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
       "</symbol>\n",
       "</defs>\n",
       "</svg>\n",
       "<style>/* CSS stylesheet for displaying xarray objects in jupyterlab.\n",
       " *\n",
       " */\n",
       "\n",
       ":root {\n",
       "  --xr-font-color0: var(\n",
       "    --jp-content-font-color0,\n",
       "    var(--pst-color-text-base rgba(0, 0, 0, 1))\n",
       "  );\n",
       "  --xr-font-color2: var(\n",
       "    --jp-content-font-color2,\n",
       "    var(--pst-color-text-base, rgba(0, 0, 0, 0.54))\n",
       "  );\n",
       "  --xr-font-color3: var(\n",
       "    --jp-content-font-color3,\n",
       "    var(--pst-color-text-base, rgba(0, 0, 0, 0.38))\n",
       "  );\n",
       "  --xr-border-color: var(\n",
       "    --jp-border-color2,\n",
       "    hsl(from var(--pst-color-on-background, white) h s calc(l - 10))\n",
       "  );\n",
       "  --xr-disabled-color: var(\n",
       "    --jp-layout-color3,\n",
       "    hsl(from var(--pst-color-on-background, white) h s calc(l - 40))\n",
       "  );\n",
       "  --xr-background-color: var(\n",
       "    --jp-layout-color0,\n",
       "    var(--pst-color-on-background, white)\n",
       "  );\n",
       "  --xr-background-color-row-even: var(\n",
       "    --jp-layout-color1,\n",
       "    hsl(from var(--pst-color-on-background, white) h s calc(l - 5))\n",
       "  );\n",
       "  --xr-background-color-row-odd: var(\n",
       "    --jp-layout-color2,\n",
       "    hsl(from var(--pst-color-on-background, white) h s calc(l - 15))\n",
       "  );\n",
       "}\n",
       "\n",
       "html[theme=\"dark\"],\n",
       "html[data-theme=\"dark\"],\n",
       "body[data-theme=\"dark\"],\n",
       "body.vscode-dark {\n",
       "  --xr-font-color0: var(\n",
       "    --jp-content-font-color0,\n",
       "    var(--pst-color-text-base, rgba(255, 255, 255, 1))\n",
       "  );\n",
       "  --xr-font-color2: var(\n",
       "    --jp-content-font-color2,\n",
       "    var(--pst-color-text-base, rgba(255, 255, 255, 0.54))\n",
       "  );\n",
       "  --xr-font-color3: var(\n",
       "    --jp-content-font-color3,\n",
       "    var(--pst-color-text-base, rgba(255, 255, 255, 0.38))\n",
       "  );\n",
       "  --xr-border-color: var(\n",
       "    --jp-border-color2,\n",
       "    hsl(from var(--pst-color-on-background, #111111) h s calc(l + 10))\n",
       "  );\n",
       "  --xr-disabled-color: var(\n",
       "    --jp-layout-color3,\n",
       "    hsl(from var(--pst-color-on-background, #111111) h s calc(l + 40))\n",
       "  );\n",
       "  --xr-background-color: var(\n",
       "    --jp-layout-color0,\n",
       "    var(--pst-color-on-background, #111111)\n",
       "  );\n",
       "  --xr-background-color-row-even: var(\n",
       "    --jp-layout-color1,\n",
       "    hsl(from var(--pst-color-on-background, #111111) h s calc(l + 5))\n",
       "  );\n",
       "  --xr-background-color-row-odd: var(\n",
       "    --jp-layout-color2,\n",
       "    hsl(from var(--pst-color-on-background, #111111) h s calc(l + 15))\n",
       "  );\n",
       "}\n",
       "\n",
       ".xr-wrap {\n",
       "  display: block !important;\n",
       "  min-width: 300px;\n",
       "  max-width: 700px;\n",
       "}\n",
       "\n",
       ".xr-text-repr-fallback {\n",
       "  /* fallback to plain text repr when CSS is not injected (untrusted notebook) */\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-header {\n",
       "  padding-top: 6px;\n",
       "  padding-bottom: 6px;\n",
       "  margin-bottom: 4px;\n",
       "  border-bottom: solid 1px var(--xr-border-color);\n",
       "}\n",
       "\n",
       ".xr-header > div,\n",
       ".xr-header > ul {\n",
       "  display: inline;\n",
       "  margin-top: 0;\n",
       "  margin-bottom: 0;\n",
       "}\n",
       "\n",
       ".xr-obj-type,\n",
       ".xr-array-name {\n",
       "  margin-left: 2px;\n",
       "  margin-right: 10px;\n",
       "}\n",
       "\n",
       ".xr-obj-type {\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-sections {\n",
       "  padding-left: 0 !important;\n",
       "  display: grid;\n",
       "  grid-template-columns: 150px auto auto 1fr 0 20px 0 20px;\n",
       "}\n",
       "\n",
       ".xr-section-item {\n",
       "  display: contents;\n",
       "}\n",
       "\n",
       ".xr-section-item input {\n",
       "  display: inline-block;\n",
       "  opacity: 0;\n",
       "  height: 0;\n",
       "}\n",
       "\n",
       ".xr-section-item input + label {\n",
       "  color: var(--xr-disabled-color);\n",
       "  border: 2px solid transparent !important;\n",
       "}\n",
       "\n",
       ".xr-section-item input:enabled + label {\n",
       "  cursor: pointer;\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-section-item input:focus + label {\n",
       "  border: 2px solid var(--xr-font-color0) !important;\n",
       "}\n",
       "\n",
       ".xr-section-item input:enabled + label:hover {\n",
       "  color: var(--xr-font-color0);\n",
       "}\n",
       "\n",
       ".xr-section-summary {\n",
       "  grid-column: 1;\n",
       "  color: var(--xr-font-color2);\n",
       "  font-weight: 500;\n",
       "}\n",
       "\n",
       ".xr-section-summary > span {\n",
       "  display: inline-block;\n",
       "  padding-left: 0.5em;\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:disabled + label {\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-section-summary-in + label:before {\n",
       "  display: inline-block;\n",
       "  content: \"►\";\n",
       "  font-size: 11px;\n",
       "  width: 15px;\n",
       "  text-align: center;\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:disabled + label:before {\n",
       "  color: var(--xr-disabled-color);\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:checked + label:before {\n",
       "  content: \"▼\";\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:checked + label > span {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-section-summary,\n",
       ".xr-section-inline-details {\n",
       "  padding-top: 4px;\n",
       "  padding-bottom: 4px;\n",
       "}\n",
       "\n",
       ".xr-section-inline-details {\n",
       "  grid-column: 2 / -1;\n",
       "}\n",
       "\n",
       ".xr-section-details {\n",
       "  display: none;\n",
       "  grid-column: 1 / -1;\n",
       "  margin-bottom: 5px;\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:checked ~ .xr-section-details {\n",
       "  display: contents;\n",
       "}\n",
       "\n",
       ".xr-array-wrap {\n",
       "  grid-column: 1 / -1;\n",
       "  display: grid;\n",
       "  grid-template-columns: 20px auto;\n",
       "}\n",
       "\n",
       ".xr-array-wrap > label {\n",
       "  grid-column: 1;\n",
       "  vertical-align: top;\n",
       "}\n",
       "\n",
       ".xr-preview {\n",
       "  color: var(--xr-font-color3);\n",
       "}\n",
       "\n",
       ".xr-array-preview,\n",
       ".xr-array-data {\n",
       "  padding: 0 5px !important;\n",
       "  grid-column: 2;\n",
       "}\n",
       "\n",
       ".xr-array-data,\n",
       ".xr-array-in:checked ~ .xr-array-preview {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-array-in:checked ~ .xr-array-data,\n",
       ".xr-array-preview {\n",
       "  display: inline-block;\n",
       "}\n",
       "\n",
       ".xr-dim-list {\n",
       "  display: inline-block !important;\n",
       "  list-style: none;\n",
       "  padding: 0 !important;\n",
       "  margin: 0;\n",
       "}\n",
       "\n",
       ".xr-dim-list li {\n",
       "  display: inline-block;\n",
       "  padding: 0;\n",
       "  margin: 0;\n",
       "}\n",
       "\n",
       ".xr-dim-list:before {\n",
       "  content: \"(\";\n",
       "}\n",
       "\n",
       ".xr-dim-list:after {\n",
       "  content: \")\";\n",
       "}\n",
       "\n",
       ".xr-dim-list li:not(:last-child):after {\n",
       "  content: \",\";\n",
       "  padding-right: 5px;\n",
       "}\n",
       "\n",
       ".xr-has-index {\n",
       "  font-weight: bold;\n",
       "}\n",
       "\n",
       ".xr-var-list,\n",
       ".xr-var-item {\n",
       "  display: contents;\n",
       "}\n",
       "\n",
       ".xr-var-item > div,\n",
       ".xr-var-item label,\n",
       ".xr-var-item > .xr-var-name span {\n",
       "  background-color: var(--xr-background-color-row-even);\n",
       "  border-color: var(--xr-background-color-row-odd);\n",
       "  margin-bottom: 0;\n",
       "  padding-top: 2px;\n",
       "}\n",
       "\n",
       ".xr-var-item > .xr-var-name:hover span {\n",
       "  padding-right: 5px;\n",
       "}\n",
       "\n",
       ".xr-var-list > li:nth-child(odd) > div,\n",
       ".xr-var-list > li:nth-child(odd) > label,\n",
       ".xr-var-list > li:nth-child(odd) > .xr-var-name span {\n",
       "  background-color: var(--xr-background-color-row-odd);\n",
       "  border-color: var(--xr-background-color-row-even);\n",
       "}\n",
       "\n",
       ".xr-var-name {\n",
       "  grid-column: 1;\n",
       "}\n",
       "\n",
       ".xr-var-dims {\n",
       "  grid-column: 2;\n",
       "}\n",
       "\n",
       ".xr-var-dtype {\n",
       "  grid-column: 3;\n",
       "  text-align: right;\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-var-preview {\n",
       "  grid-column: 4;\n",
       "}\n",
       "\n",
       ".xr-index-preview {\n",
       "  grid-column: 2 / 5;\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-var-name,\n",
       ".xr-var-dims,\n",
       ".xr-var-dtype,\n",
       ".xr-preview,\n",
       ".xr-attrs dt {\n",
       "  white-space: nowrap;\n",
       "  overflow: hidden;\n",
       "  text-overflow: ellipsis;\n",
       "  padding-right: 10px;\n",
       "}\n",
       "\n",
       ".xr-var-name:hover,\n",
       ".xr-var-dims:hover,\n",
       ".xr-var-dtype:hover,\n",
       ".xr-attrs dt:hover {\n",
       "  overflow: visible;\n",
       "  width: auto;\n",
       "  z-index: 1;\n",
       "}\n",
       "\n",
       ".xr-var-attrs,\n",
       ".xr-var-data,\n",
       ".xr-index-data {\n",
       "  display: none;\n",
       "  border-top: 2px dotted var(--xr-background-color);\n",
       "  padding-bottom: 20px !important;\n",
       "  padding-top: 10px !important;\n",
       "}\n",
       "\n",
       ".xr-var-attrs-in + label,\n",
       ".xr-var-data-in + label,\n",
       ".xr-index-data-in + label {\n",
       "  padding: 0 1px;\n",
       "}\n",
       "\n",
       ".xr-var-attrs-in:checked ~ .xr-var-attrs,\n",
       ".xr-var-data-in:checked ~ .xr-var-data,\n",
       ".xr-index-data-in:checked ~ .xr-index-data {\n",
       "  display: block;\n",
       "}\n",
       "\n",
       ".xr-var-data > table {\n",
       "  float: right;\n",
       "}\n",
       "\n",
       ".xr-var-data > pre,\n",
       ".xr-index-data > pre,\n",
       ".xr-var-data > table > tbody > tr {\n",
       "  background-color: transparent !important;\n",
       "}\n",
       "\n",
       ".xr-var-name span,\n",
       ".xr-var-data,\n",
       ".xr-index-name div,\n",
       ".xr-index-data,\n",
       ".xr-attrs {\n",
       "  padding-left: 25px !important;\n",
       "}\n",
       "\n",
       ".xr-attrs,\n",
       ".xr-var-attrs,\n",
       ".xr-var-data,\n",
       ".xr-index-data {\n",
       "  grid-column: 1 / -1;\n",
       "}\n",
       "\n",
       "dl.xr-attrs {\n",
       "  padding: 0;\n",
       "  margin: 0;\n",
       "  display: grid;\n",
       "  grid-template-columns: 125px auto;\n",
       "}\n",
       "\n",
       ".xr-attrs dt,\n",
       ".xr-attrs dd {\n",
       "  padding: 0;\n",
       "  margin: 0;\n",
       "  float: left;\n",
       "  padding-right: 10px;\n",
       "  width: auto;\n",
       "}\n",
       "\n",
       ".xr-attrs dt {\n",
       "  font-weight: normal;\n",
       "  grid-column: 1;\n",
       "}\n",
       "\n",
       ".xr-attrs dt:hover span {\n",
       "  display: inline-block;\n",
       "  background: var(--xr-background-color);\n",
       "  padding-right: 10px;\n",
       "}\n",
       "\n",
       ".xr-attrs dd {\n",
       "  grid-column: 2;\n",
       "  white-space: pre-wrap;\n",
       "  word-break: break-all;\n",
       "}\n",
       "\n",
       ".xr-icon-database,\n",
       ".xr-icon-file-text2,\n",
       ".xr-no-icon {\n",
       "  display: inline-block;\n",
       "  vertical-align: middle;\n",
       "  width: 1em;\n",
       "  height: 1.5em !important;\n",
       "  stroke-width: 0;\n",
       "  stroke: currentColor;\n",
       "  fill: currentColor;\n",
       "}\n",
       "\n",
       ".xr-var-attrs-in:checked + label > .xr-icon-file-text2,\n",
       ".xr-var-data-in:checked + label > .xr-icon-database,\n",
       ".xr-index-data-in:checked + label > .xr-icon-database {\n",
       "  color: var(--xr-font-color0);\n",
       "  filter: drop-shadow(1px 1px 5px var(--xr-font-color2));\n",
       "  stroke-width: 0.8px;\n",
       "}\n",
       "</style><pre class='xr-text-repr-fallback'>&lt;xarray.Dataset&gt; Size: 2MB\n",
       "Dimensions:       (chain: 4, draw: 1000, livebait_dim: 1, camper_dim: 1,\n",
       "                   __obs__: 64)\n",
       "Coordinates:\n",
       "  * chain         (chain) int64 32B 0 1 2 3\n",
       "  * draw          (draw) int64 8kB 0 1 2 3 4 5 6 ... 993 994 995 996 997 998 999\n",
       "  * livebait_dim  (livebait_dim) &lt;U1 4B &#x27;1&#x27;\n",
       "  * camper_dim    (camper_dim) &lt;U1 4B &#x27;1&#x27;\n",
       "  * __obs__       (__obs__) int64 512B 0 1 2 3 4 5 6 7 ... 57 58 59 60 61 62 63\n",
       "Data variables:\n",
       "    psi           (chain, draw) float64 32kB 0.4751 0.6612 ... 0.5565 0.5387\n",
       "    Intercept     (chain, draw) float64 32kB -2.655 -2.48 ... -2.59 -2.517\n",
       "    livebait      (chain, draw, livebait_dim) float64 32kB 1.936 1.784 ... 1.822\n",
       "    camper        (chain, draw, camper_dim) float64 32kB 0.6152 ... 0.5638\n",
       "    persons       (chain, draw) float64 32kB 0.864 0.8756 ... 0.8885 0.8896\n",
       "    child         (chain, draw) float64 32kB -1.399 -1.272 ... -1.474 -1.467\n",
       "    mu            (chain, draw, __obs__) float64 2MB 0.04118 0.2855 ... 0.08692\n",
       "Attributes:\n",
       "    created_at:                  2025-09-28T17:53:04.333667+00:00\n",
       "    arviz_version:               0.22.0\n",
       "    inference_library:           pymc\n",
       "    inference_library_version:   3.9.2+2907.g7a3db78e6\n",
       "    sampling_time:               5.744408369064331\n",
       "    tuning_steps:                1000\n",
       "    modeling_interface:          bambi\n",
       "    modeling_interface_version:  0.14.1.dev57+g7b2bb342c.d20250928</pre><div class='xr-wrap' style='display:none'><div class='xr-header'><div class='xr-obj-type'>xarray.Dataset</div></div><ul class='xr-sections'><li class='xr-section-item'><input id='section-ee42be93-bcef-4615-b3d9-b5f87937fa30' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-ee42be93-bcef-4615-b3d9-b5f87937fa30' class='xr-section-summary'  title='Expand/collapse section'>Dimensions:</label><div class='xr-section-inline-details'><ul class='xr-dim-list'><li><span class='xr-has-index'>chain</span>: 4</li><li><span class='xr-has-index'>draw</span>: 1000</li><li><span class='xr-has-index'>livebait_dim</span>: 1</li><li><span class='xr-has-index'>camper_dim</span>: 1</li><li><span class='xr-has-index'>__obs__</span>: 64</li></ul></div><div class='xr-section-details'></div></li><li class='xr-section-item'><input id='section-d5b9da03-1ffb-4d98-bc8e-62562f05f196' class='xr-section-summary-in' type='checkbox'  checked><label for='section-d5b9da03-1ffb-4d98-bc8e-62562f05f196' class='xr-section-summary' >Coordinates: <span>(5)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>chain</span></div><div class='xr-var-dims'>(chain)</div><div class='xr-var-dtype'>int64</div><div class='xr-var-preview xr-preview'>0 1 2 3</div><input id='attrs-850880bd-0cbe-4124-baf4-87afa2635eef' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-850880bd-0cbe-4124-baf4-87afa2635eef' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-7ee9316f-6ea1-4da7-8c01-d173a7d894af' class='xr-var-data-in' type='checkbox'><label for='data-7ee9316f-6ea1-4da7-8c01-d173a7d894af' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([0, 1, 2, 3])</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>draw</span></div><div class='xr-var-dims'>(draw)</div><div class='xr-var-dtype'>int64</div><div class='xr-var-preview xr-preview'>0 1 2 3 4 5 ... 995 996 997 998 999</div><input id='attrs-95df0672-98dd-432d-a247-0e01499bba25' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-95df0672-98dd-432d-a247-0e01499bba25' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-408e7746-3132-455d-a5e4-f64dc111deb5' class='xr-var-data-in' type='checkbox'><label for='data-408e7746-3132-455d-a5e4-f64dc111deb5' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([  0,   1,   2, ..., 997, 998, 999], shape=(1000,))</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>livebait_dim</span></div><div class='xr-var-dims'>(livebait_dim)</div><div class='xr-var-dtype'>&lt;U1</div><div class='xr-var-preview xr-preview'>&#x27;1&#x27;</div><input id='attrs-807706fc-a9d8-44b9-9ba8-d5b3bf112799' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-807706fc-a9d8-44b9-9ba8-d5b3bf112799' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-3a3b0729-221d-46a5-b710-3474315d4071' class='xr-var-data-in' type='checkbox'><label for='data-3a3b0729-221d-46a5-b710-3474315d4071' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([&#x27;1&#x27;], dtype=&#x27;&lt;U1&#x27;)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>camper_dim</span></div><div class='xr-var-dims'>(camper_dim)</div><div class='xr-var-dtype'>&lt;U1</div><div class='xr-var-preview xr-preview'>&#x27;1&#x27;</div><input id='attrs-19285127-ae78-453c-a6f9-b1219fc61bae' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-19285127-ae78-453c-a6f9-b1219fc61bae' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-8caeafdc-8578-4859-9ba5-24ce6327dc19' class='xr-var-data-in' type='checkbox'><label for='data-8caeafdc-8578-4859-9ba5-24ce6327dc19' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([&#x27;1&#x27;], dtype=&#x27;&lt;U1&#x27;)</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>__obs__</span></div><div class='xr-var-dims'>(__obs__)</div><div class='xr-var-dtype'>int64</div><div class='xr-var-preview xr-preview'>0 1 2 3 4 5 6 ... 58 59 60 61 62 63</div><input id='attrs-99bd21ce-7540-4c04-a5c7-a206f4160565' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-99bd21ce-7540-4c04-a5c7-a206f4160565' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-9e4f5dc1-c488-4dbc-a358-13d4884bb633' class='xr-var-data-in' type='checkbox'><label for='data-9e4f5dc1-c488-4dbc-a358-13d4884bb633' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16, 17,\n",
       "       18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,\n",
       "       36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,\n",
       "       54, 55, 56, 57, 58, 59, 60, 61, 62, 63])</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-ef1386e9-5780-4aec-a6d0-cf33305f8518' class='xr-section-summary-in' type='checkbox'  checked><label for='section-ef1386e9-5780-4aec-a6d0-cf33305f8518' class='xr-section-summary' >Data variables: <span>(7)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-var-name'><span>psi</span></div><div class='xr-var-dims'>(chain, draw)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>0.4751 0.6612 ... 0.5565 0.5387</div><input id='attrs-3024f8ad-97f7-4d2a-ba32-bc197fa5f64b' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-3024f8ad-97f7-4d2a-ba32-bc197fa5f64b' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-00421855-7d16-4746-920e-536d3d78178b' class='xr-var-data-in' type='checkbox'><label for='data-00421855-7d16-4746-920e-536d3d78178b' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([[0.47505204, 0.66118607, 0.57571122, ..., 0.58190278, 0.62567799,\n",
       "        0.53047598],\n",
       "       [0.66252093, 0.5891482 , 0.55873105, ..., 0.57024777, 0.62302212,\n",
       "        0.6379181 ],\n",
       "       [0.60942378, 0.62435478, 0.63496683, ..., 0.64415829, 0.64225026,\n",
       "        0.60127422],\n",
       "       [0.66630496, 0.46980712, 0.45517287, ..., 0.61960178, 0.55646107,\n",
       "        0.53872486]], shape=(4, 1000))</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>Intercept</span></div><div class='xr-var-dims'>(chain, draw)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>-2.655 -2.48 ... -2.59 -2.517</div><input id='attrs-5383c67d-107b-4b84-a486-02eb07082a26' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-5383c67d-107b-4b84-a486-02eb07082a26' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-010b3fd9-b3ff-4d29-a368-a49050976ebc' class='xr-var-data-in' type='checkbox'><label for='data-010b3fd9-b3ff-4d29-a368-a49050976ebc' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([[-2.65453728, -2.48014747, -2.43947212, ..., -2.32744299,\n",
       "        -2.21885658, -2.40076347],\n",
       "       [-2.49592977, -2.96189017, -2.45732213, ..., -2.42789096,\n",
       "        -2.57240175, -2.41380188],\n",
       "       [-1.94887941, -2.81836131, -2.86993076, ..., -2.54960719,\n",
       "        -2.28847446, -2.67300306],\n",
       "       [-2.74252748, -1.90686183, -1.91953106, ..., -2.97620999,\n",
       "        -2.58952781, -2.51701433]], shape=(4, 1000))</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>livebait</span></div><div class='xr-var-dims'>(chain, draw, livebait_dim)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>1.936 1.784 1.646 ... 1.772 1.822</div><input id='attrs-92ff42f9-707d-4725-ac0d-ade4d3ce89b8' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-92ff42f9-707d-4725-ac0d-ade4d3ce89b8' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-24533380-a14f-48d9-b6f0-f30aa619d902' class='xr-var-data-in' type='checkbox'><label for='data-24533380-a14f-48d9-b6f0-f30aa619d902' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([[[1.93634598],\n",
       "        [1.78351511],\n",
       "        [1.64585371],\n",
       "        ...,\n",
       "        [1.68453505],\n",
       "        [1.52531296],\n",
       "        [1.65994633]],\n",
       "\n",
       "       [[1.75892723],\n",
       "        [2.0332964 ],\n",
       "        [1.78381676],\n",
       "        ...,\n",
       "        [1.59273165],\n",
       "        [1.98520374],\n",
       "        [1.35598811]],\n",
       "\n",
       "       [[1.38668651],\n",
       "        [1.77360228],\n",
       "        [1.90977193],\n",
       "        ...,\n",
       "        [1.39062137],\n",
       "        [1.34452461],\n",
       "        [1.9063861 ]],\n",
       "\n",
       "       [[2.15021993],\n",
       "        [1.47721892],\n",
       "        [1.49108566],\n",
       "        ...,\n",
       "        [2.08292783],\n",
       "        [1.77188371],\n",
       "        [1.82160551]]], shape=(4, 1000, 1))</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>camper</span></div><div class='xr-var-dims'>(chain, draw, camper_dim)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>0.6152 0.5502 ... 0.6415 0.5638</div><input id='attrs-fd86b29f-45cf-42f6-9bc5-734968fceda2' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-fd86b29f-45cf-42f6-9bc5-734968fceda2' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-b207f9a2-4155-4698-b567-00e6378f6ef7' class='xr-var-data-in' type='checkbox'><label for='data-b207f9a2-4155-4698-b567-00e6378f6ef7' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([[[0.61516609],\n",
       "        [0.55024909],\n",
       "        [0.63472053],\n",
       "        ...,\n",
       "        [0.59075578],\n",
       "        [0.68666371],\n",
       "        [0.66837279]],\n",
       "\n",
       "       [[0.6776875 ],\n",
       "        [0.65136096],\n",
       "        [0.64614926],\n",
       "        ...,\n",
       "        [0.6957036 ],\n",
       "        [0.62586061],\n",
       "        [0.74264992]],\n",
       "\n",
       "       [[0.58652207],\n",
       "        [0.61359844],\n",
       "        [0.67168102],\n",
       "        ...,\n",
       "        [0.87689133],\n",
       "        [0.81821063],\n",
       "        [0.64885935]],\n",
       "\n",
       "       [[0.6753028 ],\n",
       "        [0.41250836],\n",
       "        [0.38154009],\n",
       "        ...,\n",
       "        [0.6717866 ],\n",
       "        [0.64152592],\n",
       "        [0.56377294]]], shape=(4, 1000, 1))</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>persons</span></div><div class='xr-var-dims'>(chain, draw)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>0.864 0.8756 ... 0.8885 0.8896</div><input id='attrs-638a4393-19d1-4846-8baa-2f63672c7135' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-638a4393-19d1-4846-8baa-2f63672c7135' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-6dd8da10-8f14-49b2-abbb-257d90ed01d6' class='xr-var-data-in' type='checkbox'><label for='data-6dd8da10-8f14-49b2-abbb-257d90ed01d6' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([[0.86396867, 0.87555097, 0.87076137, ..., 0.82525173, 0.8508994 ,\n",
       "        0.84094239],\n",
       "       [0.85150775, 0.89639939, 0.8186814 , ..., 0.86780995, 0.81480082,\n",
       "        0.9294559 ],\n",
       "       [0.81012519, 0.93785595, 0.89146359, ..., 0.91683796, 0.8736617 ,\n",
       "        0.85305218],\n",
       "       [0.82237691, 0.81521132, 0.83520346, ..., 0.88849766, 0.88849482,\n",
       "        0.8895511 ]], shape=(4, 1000))</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>child</span></div><div class='xr-var-dims'>(chain, draw)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>-1.399 -1.272 ... -1.474 -1.467</div><input id='attrs-34e3842b-7537-4391-89b3-184db7cc9433' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-34e3842b-7537-4391-89b3-184db7cc9433' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-0a9668aa-df5e-404e-82fa-de9ee93580b9' class='xr-var-data-in' type='checkbox'><label for='data-0a9668aa-df5e-404e-82fa-de9ee93580b9' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([[-1.39918978, -1.27176458, -1.42188044, ..., -1.28764853,\n",
       "        -1.38335914, -1.22887547],\n",
       "       [-1.50774849, -1.43886432, -1.22879453, ..., -1.27121457,\n",
       "        -1.4074095 , -1.42335677],\n",
       "       [-1.40907997, -1.2767149 , -1.23191848, ..., -1.40730834,\n",
       "        -1.34722365, -1.38066414],\n",
       "       [-1.41255481, -1.26441712, -1.29592335, ..., -1.2514328 ,\n",
       "        -1.4742868 , -1.46734638]], shape=(4, 1000))</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>mu</span></div><div class='xr-var-dims'>(chain, draw, __obs__)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>0.04118 0.2855 ... 0.01406 0.08692</div><input id='attrs-ddd04a1c-e7fb-4a8f-b5db-8f8bebaa0f9b' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-ddd04a1c-e7fb-4a8f-b5db-8f8bebaa0f9b' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-f9531ac3-ab94-44c4-943e-712adb0f41c3' class='xr-var-data-in' type='checkbox'><label for='data-f9531ac3-ab94-44c4-943e-712adb0f41c3' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([[[0.04118182, 0.28552879, 0.01016354, ..., 0.42967771,\n",
       "         0.0152946 , 0.1060431 ],\n",
       "        [0.0563394 , 0.33526099, 0.01579399, ..., 0.63161635,\n",
       "         0.02975516, 0.17706512],\n",
       "        [0.05025772, 0.26060811, 0.01212517, ..., 0.39004478,\n",
       "         0.0181474 , 0.09410217],\n",
       "        ...,\n",
       "        [0.06143106, 0.33110997, 0.01694999, ..., 0.54113266,\n",
       "         0.02770134, 0.14930869],\n",
       "        [0.06384377, 0.29346311, 0.01600786, ..., 0.4707822 ,\n",
       "         0.02568028, 0.11804152],\n",
       "        [0.06150133, 0.32343723, 0.01799661, ..., 0.67347714,\n",
       "         0.03747343, 0.19707386]],\n",
       "\n",
       "       [[0.04275922, 0.24826879, 0.00946723, ..., 0.308347  ,\n",
       "         0.01175819, 0.06827047],\n",
       "        [0.03006616, 0.22968219, 0.0071316 , ..., 0.36486487,\n",
       "         0.01132901, 0.08654485],\n",
       "        [0.05684453, 0.33836892, 0.01663528, ..., 0.6446717 ,\n",
       "         0.03169408, 0.18866004],\n",
       "...\n",
       "        [0.04783118, 0.19215437, 0.01170914, ..., 0.43315152,\n",
       "         0.02639456, 0.10603606],\n",
       "        [0.06316301, 0.2423162 , 0.01641992, ..., 0.51029649,\n",
       "         0.0345789 , 0.13265719],\n",
       "        [0.04073714, 0.27410914, 0.01024179, ..., 0.42846709,\n",
       "         0.0160092 , 0.10772156]],\n",
       "\n",
       "       [[0.0356964 , 0.30651596, 0.0086928 , ..., 0.42098354,\n",
       "         0.0119391 , 0.10251806],\n",
       "        [0.09479225, 0.41526072, 0.0267697 , ..., 0.57721489,\n",
       "         0.03721004, 0.16300771],\n",
       "        [0.09252735, 0.41099867, 0.02531966, ..., 0.55219086,\n",
       "         0.03401783, 0.15110431],\n",
       "        ...,\n",
       "        [0.03546726, 0.28472903, 0.01014699, ..., 0.65586302,\n",
       "         0.02337323, 0.18763886],\n",
       "        [0.04178074, 0.24575109, 0.00956536, ..., 0.35169207,\n",
       "         0.0136889 , 0.08051707],\n",
       "        [0.04528363, 0.27993325, 0.01043953, ..., 0.37701488,\n",
       "         0.01405998, 0.08691566]]], shape=(4, 1000, 64))</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-0d7a7d54-099a-478e-b69e-b174af3b5a0b' class='xr-section-summary-in' type='checkbox'  ><label for='section-0d7a7d54-099a-478e-b69e-b174af3b5a0b' class='xr-section-summary' >Indexes: <span>(5)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-index-name'><div>chain</div></div><div class='xr-index-preview'>PandasIndex</div><input type='checkbox' disabled/><label></label><input id='index-a3fd6820-b910-47e3-b84c-9f7e32ebb33f' class='xr-index-data-in' type='checkbox'/><label for='index-a3fd6820-b910-47e3-b84c-9f7e32ebb33f' title='Show/Hide index repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-index-data'><pre>PandasIndex(Index([0, 1, 2, 3], dtype=&#x27;int64&#x27;, name=&#x27;chain&#x27;))</pre></div></li><li class='xr-var-item'><div class='xr-index-name'><div>draw</div></div><div class='xr-index-preview'>PandasIndex</div><input type='checkbox' disabled/><label></label><input id='index-c139362f-4fdd-4a46-bfe2-6f8c05da7b0f' class='xr-index-data-in' type='checkbox'/><label for='index-c139362f-4fdd-4a46-bfe2-6f8c05da7b0f' title='Show/Hide index repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-index-data'><pre>PandasIndex(Index([  0,   1,   2,   3,   4,   5,   6,   7,   8,   9,\n",
       "       ...\n",
       "       990, 991, 992, 993, 994, 995, 996, 997, 998, 999],\n",
       "      dtype=&#x27;int64&#x27;, name=&#x27;draw&#x27;, length=1000))</pre></div></li><li class='xr-var-item'><div class='xr-index-name'><div>livebait_dim</div></div><div class='xr-index-preview'>PandasIndex</div><input type='checkbox' disabled/><label></label><input id='index-68d6ee2d-8b72-48ef-8335-90160121d2ab' class='xr-index-data-in' type='checkbox'/><label for='index-68d6ee2d-8b72-48ef-8335-90160121d2ab' title='Show/Hide index repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-index-data'><pre>PandasIndex(Index([&#x27;1&#x27;], dtype=&#x27;object&#x27;, name=&#x27;livebait_dim&#x27;))</pre></div></li><li class='xr-var-item'><div class='xr-index-name'><div>camper_dim</div></div><div class='xr-index-preview'>PandasIndex</div><input type='checkbox' disabled/><label></label><input id='index-cc5a442b-4858-4ebc-b1e3-43f708c805b1' class='xr-index-data-in' type='checkbox'/><label for='index-cc5a442b-4858-4ebc-b1e3-43f708c805b1' title='Show/Hide index repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-index-data'><pre>PandasIndex(Index([&#x27;1&#x27;], dtype=&#x27;object&#x27;, name=&#x27;camper_dim&#x27;))</pre></div></li><li class='xr-var-item'><div class='xr-index-name'><div>__obs__</div></div><div class='xr-index-preview'>PandasIndex</div><input type='checkbox' disabled/><label></label><input id='index-b8ffc038-90e0-41f6-b21b-e233bed85aeb' class='xr-index-data-in' type='checkbox'/><label for='index-b8ffc038-90e0-41f6-b21b-e233bed85aeb' title='Show/Hide index repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-index-data'><pre>PandasIndex(Index([ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16, 17,\n",
       "       18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,\n",
       "       36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,\n",
       "       54, 55, 56, 57, 58, 59, 60, 61, 62, 63],\n",
       "      dtype=&#x27;int64&#x27;, name=&#x27;__obs__&#x27;))</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-778a7aab-f8b7-4bfe-9e29-87a7cbca02fe' class='xr-section-summary-in' type='checkbox'  checked><label for='section-778a7aab-f8b7-4bfe-9e29-87a7cbca02fe' class='xr-section-summary' >Attributes: <span>(8)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><dl class='xr-attrs'><dt><span>created_at :</span></dt><dd>2025-09-28T17:53:04.333667+00:00</dd><dt><span>arviz_version :</span></dt><dd>0.22.0</dd><dt><span>inference_library :</span></dt><dd>pymc</dd><dt><span>inference_library_version :</span></dt><dd>3.9.2+2907.g7a3db78e6</dd><dt><span>sampling_time :</span></dt><dd>5.744408369064331</dd><dt><span>tuning_steps :</span></dt><dd>1000</dd><dt><span>modeling_interface :</span></dt><dd>bambi</dd><dt><span>modeling_interface_version :</span></dt><dd>0.14.1.dev57+g7b2bb342c.d20250928</dd></dl></div></li></ul></div></div><br></div>\n",
       "                      </ul>\n",
       "                  </div>\n",
       "            </li>\n",
       "            \n",
       "            <li class = \"xr-section-item\">\n",
       "                  <input id=\"idata_sample_stats8ce7eb25-0fe3-4f2c-813a-1fd51303dd89\" class=\"xr-section-summary-in\" type=\"checkbox\">\n",
       "                  <label for=\"idata_sample_stats8ce7eb25-0fe3-4f2c-813a-1fd51303dd89\" class = \"xr-section-summary\">sample_stats</label>\n",
       "                  <div class=\"xr-section-inline-details\"></div>\n",
       "                  <div class=\"xr-section-details\">\n",
       "                      <ul id=\"xr-dataset-coord-list\" class=\"xr-var-list\">\n",
       "                          <div style=\"padding-left:2rem;\"><div><svg style=\"position: absolute; width: 0; height: 0; overflow: hidden\">\n",
       "<defs>\n",
       "<symbol id=\"icon-database\" viewBox=\"0 0 32 32\">\n",
       "<path d=\"M16 0c-8.837 0-16 2.239-16 5v4c0 2.761 7.163 5 16 5s16-2.239 16-5v-4c0-2.761-7.163-5-16-5z\"></path>\n",
       "<path d=\"M16 17c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
       "<path d=\"M16 26c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
       "</symbol>\n",
       "<symbol id=\"icon-file-text2\" viewBox=\"0 0 32 32\">\n",
       "<path d=\"M28.681 7.159c-0.694-0.947-1.662-2.053-2.724-3.116s-2.169-2.030-3.116-2.724c-1.612-1.182-2.393-1.319-2.841-1.319h-15.5c-1.378 0-2.5 1.121-2.5 2.5v27c0 1.378 1.122 2.5 2.5 2.5h23c1.378 0 2.5-1.122 2.5-2.5v-19.5c0-0.448-0.137-1.23-1.319-2.841zM24.543 5.457c0.959 0.959 1.712 1.825 2.268 2.543h-4.811v-4.811c0.718 0.556 1.584 1.309 2.543 2.268zM28 29.5c0 0.271-0.229 0.5-0.5 0.5h-23c-0.271 0-0.5-0.229-0.5-0.5v-27c0-0.271 0.229-0.5 0.5-0.5 0 0 15.499-0 15.5 0v7c0 0.552 0.448 1 1 1h7v19.5z\"></path>\n",
       "<path d=\"M23 26h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
       "<path d=\"M23 22h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
       "<path d=\"M23 18h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
       "</symbol>\n",
       "</defs>\n",
       "</svg>\n",
       "<style>/* CSS stylesheet for displaying xarray objects in jupyterlab.\n",
       " *\n",
       " */\n",
       "\n",
       ":root {\n",
       "  --xr-font-color0: var(\n",
       "    --jp-content-font-color0,\n",
       "    var(--pst-color-text-base rgba(0, 0, 0, 1))\n",
       "  );\n",
       "  --xr-font-color2: var(\n",
       "    --jp-content-font-color2,\n",
       "    var(--pst-color-text-base, rgba(0, 0, 0, 0.54))\n",
       "  );\n",
       "  --xr-font-color3: var(\n",
       "    --jp-content-font-color3,\n",
       "    var(--pst-color-text-base, rgba(0, 0, 0, 0.38))\n",
       "  );\n",
       "  --xr-border-color: var(\n",
       "    --jp-border-color2,\n",
       "    hsl(from var(--pst-color-on-background, white) h s calc(l - 10))\n",
       "  );\n",
       "  --xr-disabled-color: var(\n",
       "    --jp-layout-color3,\n",
       "    hsl(from var(--pst-color-on-background, white) h s calc(l - 40))\n",
       "  );\n",
       "  --xr-background-color: var(\n",
       "    --jp-layout-color0,\n",
       "    var(--pst-color-on-background, white)\n",
       "  );\n",
       "  --xr-background-color-row-even: var(\n",
       "    --jp-layout-color1,\n",
       "    hsl(from var(--pst-color-on-background, white) h s calc(l - 5))\n",
       "  );\n",
       "  --xr-background-color-row-odd: var(\n",
       "    --jp-layout-color2,\n",
       "    hsl(from var(--pst-color-on-background, white) h s calc(l - 15))\n",
       "  );\n",
       "}\n",
       "\n",
       "html[theme=\"dark\"],\n",
       "html[data-theme=\"dark\"],\n",
       "body[data-theme=\"dark\"],\n",
       "body.vscode-dark {\n",
       "  --xr-font-color0: var(\n",
       "    --jp-content-font-color0,\n",
       "    var(--pst-color-text-base, rgba(255, 255, 255, 1))\n",
       "  );\n",
       "  --xr-font-color2: var(\n",
       "    --jp-content-font-color2,\n",
       "    var(--pst-color-text-base, rgba(255, 255, 255, 0.54))\n",
       "  );\n",
       "  --xr-font-color3: var(\n",
       "    --jp-content-font-color3,\n",
       "    var(--pst-color-text-base, rgba(255, 255, 255, 0.38))\n",
       "  );\n",
       "  --xr-border-color: var(\n",
       "    --jp-border-color2,\n",
       "    hsl(from var(--pst-color-on-background, #111111) h s calc(l + 10))\n",
       "  );\n",
       "  --xr-disabled-color: var(\n",
       "    --jp-layout-color3,\n",
       "    hsl(from var(--pst-color-on-background, #111111) h s calc(l + 40))\n",
       "  );\n",
       "  --xr-background-color: var(\n",
       "    --jp-layout-color0,\n",
       "    var(--pst-color-on-background, #111111)\n",
       "  );\n",
       "  --xr-background-color-row-even: var(\n",
       "    --jp-layout-color1,\n",
       "    hsl(from var(--pst-color-on-background, #111111) h s calc(l + 5))\n",
       "  );\n",
       "  --xr-background-color-row-odd: var(\n",
       "    --jp-layout-color2,\n",
       "    hsl(from var(--pst-color-on-background, #111111) h s calc(l + 15))\n",
       "  );\n",
       "}\n",
       "\n",
       ".xr-wrap {\n",
       "  display: block !important;\n",
       "  min-width: 300px;\n",
       "  max-width: 700px;\n",
       "}\n",
       "\n",
       ".xr-text-repr-fallback {\n",
       "  /* fallback to plain text repr when CSS is not injected (untrusted notebook) */\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-header {\n",
       "  padding-top: 6px;\n",
       "  padding-bottom: 6px;\n",
       "  margin-bottom: 4px;\n",
       "  border-bottom: solid 1px var(--xr-border-color);\n",
       "}\n",
       "\n",
       ".xr-header > div,\n",
       ".xr-header > ul {\n",
       "  display: inline;\n",
       "  margin-top: 0;\n",
       "  margin-bottom: 0;\n",
       "}\n",
       "\n",
       ".xr-obj-type,\n",
       ".xr-array-name {\n",
       "  margin-left: 2px;\n",
       "  margin-right: 10px;\n",
       "}\n",
       "\n",
       ".xr-obj-type {\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-sections {\n",
       "  padding-left: 0 !important;\n",
       "  display: grid;\n",
       "  grid-template-columns: 150px auto auto 1fr 0 20px 0 20px;\n",
       "}\n",
       "\n",
       ".xr-section-item {\n",
       "  display: contents;\n",
       "}\n",
       "\n",
       ".xr-section-item input {\n",
       "  display: inline-block;\n",
       "  opacity: 0;\n",
       "  height: 0;\n",
       "}\n",
       "\n",
       ".xr-section-item input + label {\n",
       "  color: var(--xr-disabled-color);\n",
       "  border: 2px solid transparent !important;\n",
       "}\n",
       "\n",
       ".xr-section-item input:enabled + label {\n",
       "  cursor: pointer;\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-section-item input:focus + label {\n",
       "  border: 2px solid var(--xr-font-color0) !important;\n",
       "}\n",
       "\n",
       ".xr-section-item input:enabled + label:hover {\n",
       "  color: var(--xr-font-color0);\n",
       "}\n",
       "\n",
       ".xr-section-summary {\n",
       "  grid-column: 1;\n",
       "  color: var(--xr-font-color2);\n",
       "  font-weight: 500;\n",
       "}\n",
       "\n",
       ".xr-section-summary > span {\n",
       "  display: inline-block;\n",
       "  padding-left: 0.5em;\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:disabled + label {\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-section-summary-in + label:before {\n",
       "  display: inline-block;\n",
       "  content: \"►\";\n",
       "  font-size: 11px;\n",
       "  width: 15px;\n",
       "  text-align: center;\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:disabled + label:before {\n",
       "  color: var(--xr-disabled-color);\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:checked + label:before {\n",
       "  content: \"▼\";\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:checked + label > span {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-section-summary,\n",
       ".xr-section-inline-details {\n",
       "  padding-top: 4px;\n",
       "  padding-bottom: 4px;\n",
       "}\n",
       "\n",
       ".xr-section-inline-details {\n",
       "  grid-column: 2 / -1;\n",
       "}\n",
       "\n",
       ".xr-section-details {\n",
       "  display: none;\n",
       "  grid-column: 1 / -1;\n",
       "  margin-bottom: 5px;\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:checked ~ .xr-section-details {\n",
       "  display: contents;\n",
       "}\n",
       "\n",
       ".xr-array-wrap {\n",
       "  grid-column: 1 / -1;\n",
       "  display: grid;\n",
       "  grid-template-columns: 20px auto;\n",
       "}\n",
       "\n",
       ".xr-array-wrap > label {\n",
       "  grid-column: 1;\n",
       "  vertical-align: top;\n",
       "}\n",
       "\n",
       ".xr-preview {\n",
       "  color: var(--xr-font-color3);\n",
       "}\n",
       "\n",
       ".xr-array-preview,\n",
       ".xr-array-data {\n",
       "  padding: 0 5px !important;\n",
       "  grid-column: 2;\n",
       "}\n",
       "\n",
       ".xr-array-data,\n",
       ".xr-array-in:checked ~ .xr-array-preview {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-array-in:checked ~ .xr-array-data,\n",
       ".xr-array-preview {\n",
       "  display: inline-block;\n",
       "}\n",
       "\n",
       ".xr-dim-list {\n",
       "  display: inline-block !important;\n",
       "  list-style: none;\n",
       "  padding: 0 !important;\n",
       "  margin: 0;\n",
       "}\n",
       "\n",
       ".xr-dim-list li {\n",
       "  display: inline-block;\n",
       "  padding: 0;\n",
       "  margin: 0;\n",
       "}\n",
       "\n",
       ".xr-dim-list:before {\n",
       "  content: \"(\";\n",
       "}\n",
       "\n",
       ".xr-dim-list:after {\n",
       "  content: \")\";\n",
       "}\n",
       "\n",
       ".xr-dim-list li:not(:last-child):after {\n",
       "  content: \",\";\n",
       "  padding-right: 5px;\n",
       "}\n",
       "\n",
       ".xr-has-index {\n",
       "  font-weight: bold;\n",
       "}\n",
       "\n",
       ".xr-var-list,\n",
       ".xr-var-item {\n",
       "  display: contents;\n",
       "}\n",
       "\n",
       ".xr-var-item > div,\n",
       ".xr-var-item label,\n",
       ".xr-var-item > .xr-var-name span {\n",
       "  background-color: var(--xr-background-color-row-even);\n",
       "  border-color: var(--xr-background-color-row-odd);\n",
       "  margin-bottom: 0;\n",
       "  padding-top: 2px;\n",
       "}\n",
       "\n",
       ".xr-var-item > .xr-var-name:hover span {\n",
       "  padding-right: 5px;\n",
       "}\n",
       "\n",
       ".xr-var-list > li:nth-child(odd) > div,\n",
       ".xr-var-list > li:nth-child(odd) > label,\n",
       ".xr-var-list > li:nth-child(odd) > .xr-var-name span {\n",
       "  background-color: var(--xr-background-color-row-odd);\n",
       "  border-color: var(--xr-background-color-row-even);\n",
       "}\n",
       "\n",
       ".xr-var-name {\n",
       "  grid-column: 1;\n",
       "}\n",
       "\n",
       ".xr-var-dims {\n",
       "  grid-column: 2;\n",
       "}\n",
       "\n",
       ".xr-var-dtype {\n",
       "  grid-column: 3;\n",
       "  text-align: right;\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-var-preview {\n",
       "  grid-column: 4;\n",
       "}\n",
       "\n",
       ".xr-index-preview {\n",
       "  grid-column: 2 / 5;\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-var-name,\n",
       ".xr-var-dims,\n",
       ".xr-var-dtype,\n",
       ".xr-preview,\n",
       ".xr-attrs dt {\n",
       "  white-space: nowrap;\n",
       "  overflow: hidden;\n",
       "  text-overflow: ellipsis;\n",
       "  padding-right: 10px;\n",
       "}\n",
       "\n",
       ".xr-var-name:hover,\n",
       ".xr-var-dims:hover,\n",
       ".xr-var-dtype:hover,\n",
       ".xr-attrs dt:hover {\n",
       "  overflow: visible;\n",
       "  width: auto;\n",
       "  z-index: 1;\n",
       "}\n",
       "\n",
       ".xr-var-attrs,\n",
       ".xr-var-data,\n",
       ".xr-index-data {\n",
       "  display: none;\n",
       "  border-top: 2px dotted var(--xr-background-color);\n",
       "  padding-bottom: 20px !important;\n",
       "  padding-top: 10px !important;\n",
       "}\n",
       "\n",
       ".xr-var-attrs-in + label,\n",
       ".xr-var-data-in + label,\n",
       ".xr-index-data-in + label {\n",
       "  padding: 0 1px;\n",
       "}\n",
       "\n",
       ".xr-var-attrs-in:checked ~ .xr-var-attrs,\n",
       ".xr-var-data-in:checked ~ .xr-var-data,\n",
       ".xr-index-data-in:checked ~ .xr-index-data {\n",
       "  display: block;\n",
       "}\n",
       "\n",
       ".xr-var-data > table {\n",
       "  float: right;\n",
       "}\n",
       "\n",
       ".xr-var-data > pre,\n",
       ".xr-index-data > pre,\n",
       ".xr-var-data > table > tbody > tr {\n",
       "  background-color: transparent !important;\n",
       "}\n",
       "\n",
       ".xr-var-name span,\n",
       ".xr-var-data,\n",
       ".xr-index-name div,\n",
       ".xr-index-data,\n",
       ".xr-attrs {\n",
       "  padding-left: 25px !important;\n",
       "}\n",
       "\n",
       ".xr-attrs,\n",
       ".xr-var-attrs,\n",
       ".xr-var-data,\n",
       ".xr-index-data {\n",
       "  grid-column: 1 / -1;\n",
       "}\n",
       "\n",
       "dl.xr-attrs {\n",
       "  padding: 0;\n",
       "  margin: 0;\n",
       "  display: grid;\n",
       "  grid-template-columns: 125px auto;\n",
       "}\n",
       "\n",
       ".xr-attrs dt,\n",
       ".xr-attrs dd {\n",
       "  padding: 0;\n",
       "  margin: 0;\n",
       "  float: left;\n",
       "  padding-right: 10px;\n",
       "  width: auto;\n",
       "}\n",
       "\n",
       ".xr-attrs dt {\n",
       "  font-weight: normal;\n",
       "  grid-column: 1;\n",
       "}\n",
       "\n",
       ".xr-attrs dt:hover span {\n",
       "  display: inline-block;\n",
       "  background: var(--xr-background-color);\n",
       "  padding-right: 10px;\n",
       "}\n",
       "\n",
       ".xr-attrs dd {\n",
       "  grid-column: 2;\n",
       "  white-space: pre-wrap;\n",
       "  word-break: break-all;\n",
       "}\n",
       "\n",
       ".xr-icon-database,\n",
       ".xr-icon-file-text2,\n",
       ".xr-no-icon {\n",
       "  display: inline-block;\n",
       "  vertical-align: middle;\n",
       "  width: 1em;\n",
       "  height: 1.5em !important;\n",
       "  stroke-width: 0;\n",
       "  stroke: currentColor;\n",
       "  fill: currentColor;\n",
       "}\n",
       "\n",
       ".xr-var-attrs-in:checked + label > .xr-icon-file-text2,\n",
       ".xr-var-data-in:checked + label > .xr-icon-database,\n",
       ".xr-index-data-in:checked + label > .xr-icon-database {\n",
       "  color: var(--xr-font-color0);\n",
       "  filter: drop-shadow(1px 1px 5px var(--xr-font-color2));\n",
       "  stroke-width: 0.8px;\n",
       "}\n",
       "</style><pre class='xr-text-repr-fallback'>&lt;xarray.Dataset&gt; Size: 528kB\n",
       "Dimensions:                (chain: 4, draw: 1000)\n",
       "Coordinates:\n",
       "  * chain                  (chain) int64 32B 0 1 2 3\n",
       "  * draw                   (draw) int64 8kB 0 1 2 3 4 5 ... 995 996 997 998 999\n",
       "Data variables: (12/18)\n",
       "    process_time_diff      (chain, draw) float64 32kB 0.00177 ... 0.001431\n",
       "    index_in_trajectory    (chain, draw) int64 32kB -2 4 3 6 -6 ... 5 -4 5 3 13\n",
       "    max_energy_error       (chain, draw) float64 32kB 2.184 1.865 ... 1.111\n",
       "    perf_counter_start     (chain, draw) float64 32kB 2.045e+05 ... 2.045e+05\n",
       "    reached_max_treedepth  (chain, draw) bool 4kB False False ... False False\n",
       "    energy_error           (chain, draw) float64 32kB -0.1267 0.02556 ... 1.111\n",
       "    ...                     ...\n",
       "    n_steps                (chain, draw) float64 32kB 7.0 7.0 7.0 ... 7.0 15.0\n",
       "    step_size_bar          (chain, draw) float64 32kB 0.463 0.463 ... 0.4197\n",
       "    energy                 (chain, draw) float64 32kB 762.8 759.5 ... 755.8\n",
       "    diverging              (chain, draw) bool 4kB False False ... False False\n",
       "    perf_counter_diff      (chain, draw) float64 32kB 0.001946 ... 0.001552\n",
       "    smallest_eigval        (chain, draw) float64 32kB nan nan nan ... nan nan\n",
       "Attributes:\n",
       "    created_at:                  2025-09-28T17:53:04.353984+00:00\n",
       "    arviz_version:               0.22.0\n",
       "    inference_library:           pymc\n",
       "    inference_library_version:   3.9.2+2907.g7a3db78e6\n",
       "    sampling_time:               5.744408369064331\n",
       "    tuning_steps:                1000\n",
       "    modeling_interface:          bambi\n",
       "    modeling_interface_version:  0.14.1.dev57+g7b2bb342c.d20250928</pre><div class='xr-wrap' style='display:none'><div class='xr-header'><div class='xr-obj-type'>xarray.Dataset</div></div><ul class='xr-sections'><li class='xr-section-item'><input id='section-d1f54fc8-ed08-4ab4-908e-cbc711c14793' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-d1f54fc8-ed08-4ab4-908e-cbc711c14793' class='xr-section-summary'  title='Expand/collapse section'>Dimensions:</label><div class='xr-section-inline-details'><ul class='xr-dim-list'><li><span class='xr-has-index'>chain</span>: 4</li><li><span class='xr-has-index'>draw</span>: 1000</li></ul></div><div class='xr-section-details'></div></li><li class='xr-section-item'><input id='section-a7b3cbf7-2e5a-4fce-bd16-d40b582a4b51' class='xr-section-summary-in' type='checkbox'  checked><label for='section-a7b3cbf7-2e5a-4fce-bd16-d40b582a4b51' class='xr-section-summary' >Coordinates: <span>(2)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>chain</span></div><div class='xr-var-dims'>(chain)</div><div class='xr-var-dtype'>int64</div><div class='xr-var-preview xr-preview'>0 1 2 3</div><input id='attrs-aced12f2-5290-40d4-8a16-39640d877bff' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-aced12f2-5290-40d4-8a16-39640d877bff' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-65fc76c3-86c8-47e8-a0a6-a4f12bc01e67' class='xr-var-data-in' type='checkbox'><label for='data-65fc76c3-86c8-47e8-a0a6-a4f12bc01e67' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([0, 1, 2, 3])</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>draw</span></div><div class='xr-var-dims'>(draw)</div><div class='xr-var-dtype'>int64</div><div class='xr-var-preview xr-preview'>0 1 2 3 4 5 ... 995 996 997 998 999</div><input id='attrs-d76e3468-d49d-4afb-ae83-885a3b9216c9' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-d76e3468-d49d-4afb-ae83-885a3b9216c9' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-ccc77fde-29e5-4d17-802f-abba129f87e9' class='xr-var-data-in' type='checkbox'><label for='data-ccc77fde-29e5-4d17-802f-abba129f87e9' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([  0,   1,   2, ..., 997, 998, 999], shape=(1000,))</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-d0c67596-c0bf-4643-8080-0cb98e56aa26' class='xr-section-summary-in' type='checkbox'  ><label for='section-d0c67596-c0bf-4643-8080-0cb98e56aa26' class='xr-section-summary' >Data variables: <span>(18)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-var-name'><span>process_time_diff</span></div><div class='xr-var-dims'>(chain, draw)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>0.00177 0.002007 ... 0.001431</div><input id='attrs-8f768473-25cd-4574-83c4-0bf875110529' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-8f768473-25cd-4574-83c4-0bf875110529' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-0fedf329-edcc-4be1-8090-1e7ac31698d5' class='xr-var-data-in' type='checkbox'><label for='data-0fedf329-edcc-4be1-8090-1e7ac31698d5' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([[0.0017698, 0.0020073, 0.0019871, ..., 0.0013771, 0.0010966,\n",
       "        0.0008205],\n",
       "       [0.0022362, 0.0010605, 0.002827 , ..., 0.0027154, 0.001546 ,\n",
       "        0.0015522],\n",
       "       [0.0019279, 0.0019871, 0.0037933, ..., 0.0009135, 0.0016638,\n",
       "        0.0007657],\n",
       "       [0.0019091, 0.0032898, 0.0020698, ..., 0.0008818, 0.0007678,\n",
       "        0.0014314]], shape=(4, 1000))</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>index_in_trajectory</span></div><div class='xr-var-dims'>(chain, draw)</div><div class='xr-var-dtype'>int64</div><div class='xr-var-preview xr-preview'>-2 4 3 6 -6 -2 3 ... 4 5 -4 5 3 13</div><input id='attrs-05a0c7f0-dca3-4dda-9361-c65678502762' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-05a0c7f0-dca3-4dda-9361-c65678502762' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-b156258b-1b1f-4467-a36b-b5a8d5031b2f' class='xr-var-data-in' type='checkbox'><label for='data-b156258b-1b1f-4467-a36b-b5a8d5031b2f' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([[-2,  4,  3, ...,  5, -2,  6],\n",
       "       [-9, -3,  4, ..., -4,  5,  6],\n",
       "       [-3, -3, 12, ..., -4, 15, -5],\n",
       "       [13, -5, -1, ...,  5,  3, 13]], shape=(4, 1000))</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>max_energy_error</span></div><div class='xr-var-dims'>(chain, draw)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>2.184 1.865 ... 0.07214 1.111</div><input id='attrs-9ca3d133-164a-482b-a0c3-6bfb1062b9af' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-9ca3d133-164a-482b-a0c3-6bfb1062b9af' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-8425615d-c208-4e54-882f-59550a43c375' class='xr-var-data-in' type='checkbox'><label for='data-8425615d-c208-4e54-882f-59550a43c375' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([[ 2.18413835,  1.86501249, -0.34778222, ...,  0.38297837,\n",
       "        -0.55413146, -0.37703349],\n",
       "       [-0.80521076,  0.66475682, -0.51290278, ...,  0.70322474,\n",
       "         0.13051808,  0.11547728],\n",
       "       [-0.25059241,  0.40179839,  0.51608246, ...,  1.00844166,\n",
       "         0.99224621,  0.49619473],\n",
       "       [ 0.0922762 , -0.26885173, -0.28300683, ..., -0.11904773,\n",
       "         0.072136  ,  1.11066162]], shape=(4, 1000))</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>perf_counter_start</span></div><div class='xr-var-dims'>(chain, draw)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>2.045e+05 2.045e+05 ... 2.045e+05</div><input id='attrs-92073125-d51b-4416-925e-259e820209d7' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-92073125-d51b-4416-925e-259e820209d7' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-51ac0d88-a94f-4d42-ad60-263de6f5f4d2' class='xr-var-data-in' type='checkbox'><label for='data-51ac0d88-a94f-4d42-ad60-263de6f5f4d2' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([[204453.01892517, 204453.02114937, 204453.02358408, ...,\n",
       "        204454.97468938, 204454.97644201, 204454.97781465],\n",
       "       [204452.79561392, 204452.79831157, 204452.79963924, ...,\n",
       "        204454.88499231, 204454.88814699, 204454.89010748],\n",
       "       [204453.021237  , 204453.02358418, 204453.02607497, ...,\n",
       "        204455.15433299, 204455.15548246, 204455.15747582],\n",
       "       [204453.08017075, 204453.0824367 , 204453.09739496, ...,\n",
       "        204455.21121396, 204455.21231873, 204455.21329086]],\n",
       "      shape=(4, 1000))</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>reached_max_treedepth</span></div><div class='xr-var-dims'>(chain, draw)</div><div class='xr-var-dtype'>bool</div><div class='xr-var-preview xr-preview'>False False False ... False False</div><input id='attrs-66ff3fcd-204c-4ad1-b28f-9d48e018551f' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-66ff3fcd-204c-4ad1-b28f-9d48e018551f' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-040483ff-07a7-4166-80e6-e1061eead51e' class='xr-var-data-in' type='checkbox'><label for='data-040483ff-07a7-4166-80e6-e1061eead51e' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([[False, False, False, ..., False, False, False],\n",
       "       [False, False, False, ..., False, False, False],\n",
       "       [False, False, False, ..., False, False, False],\n",
       "       [False, False, False, ..., False, False, False]], shape=(4, 1000))</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>energy_error</span></div><div class='xr-var-dims'>(chain, draw)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>-0.1267 0.02556 ... -0.008317 1.111</div><input id='attrs-31addb32-75d8-497e-ac6b-bcc13504ec82' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-31addb32-75d8-497e-ac6b-bcc13504ec82' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-477b89df-fda2-4e4b-bf16-4ab4fe9e35af' class='xr-var-data-in' type='checkbox'><label for='data-477b89df-fda2-4e4b-bf16-4ab4fe9e35af' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([[-0.12670574,  0.02555692, -0.34337592, ...,  0.37143005,\n",
       "         0.06623665, -0.34916326],\n",
       "       [-0.75130688,  0.6325036 ,  0.00702398, ..., -0.07080415,\n",
       "         0.11888384,  0.0096263 ],\n",
       "       [-0.07545402, -0.04947368,  0.43992906, ..., -0.12149239,\n",
       "        -0.02681514,  0.23165522],\n",
       "       [-0.03899448, -0.0707252 ,  0.04399099, ..., -0.05644536,\n",
       "        -0.00831714,  1.11066162]], shape=(4, 1000))</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>lp</span></div><div class='xr-var-dims'>(chain, draw)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>-755.7 -753.7 ... -751.4 -754.4</div><input id='attrs-94b3031f-b8e1-4fab-88ce-8a739c818e39' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-94b3031f-b8e1-4fab-88ce-8a739c818e39' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-6a719e8e-07dc-4cbc-bbc6-ee99016d1510' class='xr-var-data-in' type='checkbox'><label for='data-6a719e8e-07dc-4cbc-bbc6-ee99016d1510' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([[-755.67091538, -753.67155712, -750.38917968, ..., -751.76303739,\n",
       "        -751.72505089, -752.27790912],\n",
       "       [-750.97967656, -752.7216474 , -752.68607572, ..., -750.70638629,\n",
       "        -751.43232804, -751.76796888],\n",
       "       [-752.6836068 , -752.28115879, -753.22404726, ..., -753.01476202,\n",
       "        -752.20287966, -750.72905087],\n",
       "       [-753.62922258, -758.97727593, -760.86075571, ..., -752.10404338,\n",
       "        -751.41332297, -754.38218058]], shape=(4, 1000))</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>divergences</span></div><div class='xr-var-dims'>(chain, draw)</div><div class='xr-var-dtype'>int64</div><div class='xr-var-preview xr-preview'>0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 0</div><input id='attrs-418ed94f-1674-4a8d-ab0f-e4dac89fd234' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-418ed94f-1674-4a8d-ab0f-e4dac89fd234' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-bcdf215c-eaf8-4164-9406-75a0c9e536e1' class='xr-var-data-in' type='checkbox'><label for='data-bcdf215c-eaf8-4164-9406-75a0c9e536e1' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([[0, 0, 0, ..., 0, 0, 0],\n",
       "       [0, 0, 0, ..., 0, 0, 0],\n",
       "       [0, 0, 0, ..., 0, 0, 0],\n",
       "       [0, 0, 0, ..., 0, 0, 0]], shape=(4, 1000))</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>largest_eigval</span></div><div class='xr-var-dims'>(chain, draw)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>nan nan nan nan ... nan nan nan nan</div><input id='attrs-c08bc3ba-a787-45ca-aa5c-2d6930374e07' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-c08bc3ba-a787-45ca-aa5c-2d6930374e07' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-f1f4c7cb-6b96-4087-85d3-c9eeed4df6fd' class='xr-var-data-in' type='checkbox'><label for='data-f1f4c7cb-6b96-4087-85d3-c9eeed4df6fd' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([[nan, nan, nan, ..., nan, nan, nan],\n",
       "       [nan, nan, nan, ..., nan, nan, nan],\n",
       "       [nan, nan, nan, ..., nan, nan, nan],\n",
       "       [nan, nan, nan, ..., nan, nan, nan]], shape=(4, 1000))</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>tree_depth</span></div><div class='xr-var-dims'>(chain, draw)</div><div class='xr-var-dtype'>int64</div><div class='xr-var-preview xr-preview'>3 3 3 3 3 3 4 3 ... 4 3 3 3 3 3 3 4</div><input id='attrs-d3f7fdfb-d829-499d-9f5c-58bd7dfa2ede' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-d3f7fdfb-d829-499d-9f5c-58bd7dfa2ede' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-f956b1aa-7f4c-4adc-ac98-57d6fe9869b7' class='xr-var-data-in' type='checkbox'><label for='data-f956b1aa-7f4c-4adc-ac98-57d6fe9869b7' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([[3, 3, 3, ..., 3, 3, 3],\n",
       "       [4, 3, 4, ..., 4, 3, 3],\n",
       "       [3, 3, 4, ..., 3, 4, 3],\n",
       "       [4, 4, 3, ..., 3, 3, 4]], shape=(4, 1000))</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>step_size</span></div><div class='xr-var-dims'>(chain, draw)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>0.3998 0.3998 ... 0.4525 0.4525</div><input id='attrs-cb825350-8844-47a3-9e9b-d4fff58ff3d8' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-cb825350-8844-47a3-9e9b-d4fff58ff3d8' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-bdde38e2-ee6e-472e-bf8d-2c49d9d847cd' class='xr-var-data-in' type='checkbox'><label for='data-bdde38e2-ee6e-472e-bf8d-2c49d9d847cd' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([[0.39984063, 0.39984063, 0.39984063, ..., 0.39984063, 0.39984063,\n",
       "        0.39984063],\n",
       "       [0.43855996, 0.43855996, 0.43855996, ..., 0.43855996, 0.43855996,\n",
       "        0.43855996],\n",
       "       [0.47311063, 0.47311063, 0.47311063, ..., 0.47311063, 0.47311063,\n",
       "        0.47311063],\n",
       "       [0.45254452, 0.45254452, 0.45254452, ..., 0.45254452, 0.45254452,\n",
       "        0.45254452]], shape=(4, 1000))</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>acceptance_rate</span></div><div class='xr-var-dims'>(chain, draw)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>0.4448 0.4935 1.0 ... 0.9765 0.6551</div><input id='attrs-b75bc10b-4c00-4f53-bbe6-6c4a876d19cb' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-b75bc10b-4c00-4f53-bbe6-6c4a876d19cb' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-170cbefe-7b62-41ac-92a5-39df071a27b7' class='xr-var-data-in' type='checkbox'><label for='data-170cbefe-7b62-41ac-92a5-39df071a27b7' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([[0.44484216, 0.49353371, 1.        , ..., 0.84425068, 0.98423452,\n",
       "        0.97354558],\n",
       "       [0.98381259, 0.71698876, 0.97393013, ..., 0.74891399, 0.91987007,\n",
       "        0.96645363],\n",
       "       [0.99044968, 0.87369173, 0.84641834, ..., 0.68483477, 0.66432019,\n",
       "        0.79750891],\n",
       "       [0.97159345, 0.95442976, 0.98573047, ..., 1.        , 0.97652523,\n",
       "        0.65514232]], shape=(4, 1000))</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>n_steps</span></div><div class='xr-var-dims'>(chain, draw)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>7.0 7.0 7.0 7.0 ... 7.0 7.0 15.0</div><input id='attrs-39adaa86-123b-4cd8-8a44-52a90190b6fd' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-39adaa86-123b-4cd8-8a44-52a90190b6fd' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-ef29f7b4-1046-482e-af77-2c9b056fa3f6' class='xr-var-data-in' type='checkbox'><label for='data-ef29f7b4-1046-482e-af77-2c9b056fa3f6' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([[ 7.,  7.,  7., ...,  7.,  7.,  7.],\n",
       "       [15.,  7., 15., ..., 15.,  7.,  7.],\n",
       "       [ 7.,  7., 15., ...,  7., 15.,  7.],\n",
       "       [15., 15.,  7., ...,  7.,  7., 15.]], shape=(4, 1000))</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>step_size_bar</span></div><div class='xr-var-dims'>(chain, draw)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>0.463 0.463 0.463 ... 0.4197 0.4197</div><input id='attrs-8f25184d-354b-4880-956f-79edd2145515' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-8f25184d-354b-4880-956f-79edd2145515' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-2ff8f742-0df2-439a-b231-fcd0b024c5ac' class='xr-var-data-in' type='checkbox'><label for='data-2ff8f742-0df2-439a-b231-fcd0b024c5ac' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([[0.4630148 , 0.4630148 , 0.4630148 , ..., 0.4630148 , 0.4630148 ,\n",
       "        0.4630148 ],\n",
       "       [0.45538173, 0.45538173, 0.45538173, ..., 0.45538173, 0.45538173,\n",
       "        0.45538173],\n",
       "       [0.44061191, 0.44061191, 0.44061191, ..., 0.44061191, 0.44061191,\n",
       "        0.44061191],\n",
       "       [0.41966235, 0.41966235, 0.41966235, ..., 0.41966235, 0.41966235,\n",
       "        0.41966235]], shape=(4, 1000))</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>energy</span></div><div class='xr-var-dims'>(chain, draw)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>762.8 759.5 754.2 ... 754.0 755.8</div><input id='attrs-8a8be8d1-0da9-4e9c-a642-5f9ac4d89947' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-8a8be8d1-0da9-4e9c-a642-5f9ac4d89947' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-7a80208c-e298-46f8-9768-c545adaaee54' class='xr-var-data-in' type='checkbox'><label for='data-7a80208c-e298-46f8-9768-c545adaaee54' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([[762.79877504, 759.54625228, 754.17185912, ..., 752.71000354,\n",
       "        753.45414896, 756.11838657],\n",
       "       [752.63566584, 753.81393693, 757.09634008, ..., 753.19788792,\n",
       "        752.58634373, 754.93827441],\n",
       "       [756.43554461, 756.9626317 , 756.31684022, ..., 756.27732139,\n",
       "        754.66357716, 753.74312919],\n",
       "       [758.82125131, 763.33711627, 761.61151457, ..., 754.68409891,\n",
       "        754.01154025, 755.77150518]], shape=(4, 1000))</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>diverging</span></div><div class='xr-var-dims'>(chain, draw)</div><div class='xr-var-dtype'>bool</div><div class='xr-var-preview xr-preview'>False False False ... False False</div><input id='attrs-4cd4260a-ba0d-4f25-9559-5e5fb144336a' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-4cd4260a-ba0d-4f25-9559-5e5fb144336a' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-9a2e6e3f-c2d8-44f1-b249-a22c7fc3316c' class='xr-var-data-in' type='checkbox'><label for='data-9a2e6e3f-c2d8-44f1-b249-a22c7fc3316c' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([[False, False, False, ..., False, False, False],\n",
       "       [False, False, False, ..., False, False, False],\n",
       "       [False, False, False, ..., False, False, False],\n",
       "       [False, False, False, ..., False, False, False]], shape=(4, 1000))</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>perf_counter_diff</span></div><div class='xr-var-dims'>(chain, draw)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>0.001946 0.002206 ... 0.001552</div><input id='attrs-185922e5-e8a8-4757-b04b-91ae4adae227' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-185922e5-e8a8-4757-b04b-91ae4adae227' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-102cf6ae-642f-4fcb-b47a-3c0f047bd3fb' class='xr-var-data-in' type='checkbox'><label for='data-102cf6ae-642f-4fcb-b47a-3c0f047bd3fb' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([[0.00194558, 0.00220633, 0.00218391, ..., 0.00149219, 0.00118894,\n",
       "        0.0008902 ],\n",
       "       [0.0024579 , 0.00116698, 0.00310552, ..., 0.00294279, 0.00167569,\n",
       "        0.0016828 ],\n",
       "       [0.00211933, 0.00218255, 0.00417005, ..., 0.00099017, 0.00180081,\n",
       "        0.00083081],\n",
       "       [0.00209892, 0.00361377, 0.0022756 , ..., 0.00095534, 0.00083204,\n",
       "        0.00155204]], shape=(4, 1000))</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span>smallest_eigval</span></div><div class='xr-var-dims'>(chain, draw)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>nan nan nan nan ... nan nan nan nan</div><input id='attrs-83876c91-833d-43c0-b05f-d750a3306f21' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-83876c91-833d-43c0-b05f-d750a3306f21' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-ab81fc9a-305f-4a48-b7d3-4d2c281cf521' class='xr-var-data-in' type='checkbox'><label for='data-ab81fc9a-305f-4a48-b7d3-4d2c281cf521' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([[nan, nan, nan, ..., nan, nan, nan],\n",
       "       [nan, nan, nan, ..., nan, nan, nan],\n",
       "       [nan, nan, nan, ..., nan, nan, nan],\n",
       "       [nan, nan, nan, ..., nan, nan, nan]], shape=(4, 1000))</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-30a8accb-8327-41c6-baa0-994ad3787056' class='xr-section-summary-in' type='checkbox'  ><label for='section-30a8accb-8327-41c6-baa0-994ad3787056' class='xr-section-summary' >Indexes: <span>(2)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-index-name'><div>chain</div></div><div class='xr-index-preview'>PandasIndex</div><input type='checkbox' disabled/><label></label><input id='index-e972dc43-5691-42d9-b56e-d6fcf57d9dbf' class='xr-index-data-in' type='checkbox'/><label for='index-e972dc43-5691-42d9-b56e-d6fcf57d9dbf' title='Show/Hide index repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-index-data'><pre>PandasIndex(Index([0, 1, 2, 3], dtype=&#x27;int64&#x27;, name=&#x27;chain&#x27;))</pre></div></li><li class='xr-var-item'><div class='xr-index-name'><div>draw</div></div><div class='xr-index-preview'>PandasIndex</div><input type='checkbox' disabled/><label></label><input id='index-7762abc0-b21c-47a9-9fec-f265b9a11522' class='xr-index-data-in' type='checkbox'/><label for='index-7762abc0-b21c-47a9-9fec-f265b9a11522' title='Show/Hide index repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-index-data'><pre>PandasIndex(Index([  0,   1,   2,   3,   4,   5,   6,   7,   8,   9,\n",
       "       ...\n",
       "       990, 991, 992, 993, 994, 995, 996, 997, 998, 999],\n",
       "      dtype=&#x27;int64&#x27;, name=&#x27;draw&#x27;, length=1000))</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-cb464f65-0f56-43f5-8608-fba2d7c7e24c' class='xr-section-summary-in' type='checkbox'  checked><label for='section-cb464f65-0f56-43f5-8608-fba2d7c7e24c' class='xr-section-summary' >Attributes: <span>(8)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><dl class='xr-attrs'><dt><span>created_at :</span></dt><dd>2025-09-28T17:53:04.353984+00:00</dd><dt><span>arviz_version :</span></dt><dd>0.22.0</dd><dt><span>inference_library :</span></dt><dd>pymc</dd><dt><span>inference_library_version :</span></dt><dd>3.9.2+2907.g7a3db78e6</dd><dt><span>sampling_time :</span></dt><dd>5.744408369064331</dd><dt><span>tuning_steps :</span></dt><dd>1000</dd><dt><span>modeling_interface :</span></dt><dd>bambi</dd><dt><span>modeling_interface_version :</span></dt><dd>0.14.1.dev57+g7b2bb342c.d20250928</dd></dl></div></li></ul></div></div><br></div>\n",
       "                      </ul>\n",
       "                  </div>\n",
       "            </li>\n",
       "            \n",
       "            <li class = \"xr-section-item\">\n",
       "                  <input id=\"idata_observed_datac9ccf96e-5276-4408-830c-2e402dbc4580\" class=\"xr-section-summary-in\" type=\"checkbox\">\n",
       "                  <label for=\"idata_observed_datac9ccf96e-5276-4408-830c-2e402dbc4580\" class = \"xr-section-summary\">observed_data</label>\n",
       "                  <div class=\"xr-section-inline-details\"></div>\n",
       "                  <div class=\"xr-section-details\">\n",
       "                      <ul id=\"xr-dataset-coord-list\" class=\"xr-var-list\">\n",
       "                          <div style=\"padding-left:2rem;\"><div><svg style=\"position: absolute; width: 0; height: 0; overflow: hidden\">\n",
       "<defs>\n",
       "<symbol id=\"icon-database\" viewBox=\"0 0 32 32\">\n",
       "<path d=\"M16 0c-8.837 0-16 2.239-16 5v4c0 2.761 7.163 5 16 5s16-2.239 16-5v-4c0-2.761-7.163-5-16-5z\"></path>\n",
       "<path d=\"M16 17c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
       "<path d=\"M16 26c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
       "</symbol>\n",
       "<symbol id=\"icon-file-text2\" viewBox=\"0 0 32 32\">\n",
       "<path d=\"M28.681 7.159c-0.694-0.947-1.662-2.053-2.724-3.116s-2.169-2.030-3.116-2.724c-1.612-1.182-2.393-1.319-2.841-1.319h-15.5c-1.378 0-2.5 1.121-2.5 2.5v27c0 1.378 1.122 2.5 2.5 2.5h23c1.378 0 2.5-1.122 2.5-2.5v-19.5c0-0.448-0.137-1.23-1.319-2.841zM24.543 5.457c0.959 0.959 1.712 1.825 2.268 2.543h-4.811v-4.811c0.718 0.556 1.584 1.309 2.543 2.268zM28 29.5c0 0.271-0.229 0.5-0.5 0.5h-23c-0.271 0-0.5-0.229-0.5-0.5v-27c0-0.271 0.229-0.5 0.5-0.5 0 0 15.499-0 15.5 0v7c0 0.552 0.448 1 1 1h7v19.5z\"></path>\n",
       "<path d=\"M23 26h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
       "<path d=\"M23 22h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
       "<path d=\"M23 18h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
       "</symbol>\n",
       "</defs>\n",
       "</svg>\n",
       "<style>/* CSS stylesheet for displaying xarray objects in jupyterlab.\n",
       " *\n",
       " */\n",
       "\n",
       ":root {\n",
       "  --xr-font-color0: var(\n",
       "    --jp-content-font-color0,\n",
       "    var(--pst-color-text-base rgba(0, 0, 0, 1))\n",
       "  );\n",
       "  --xr-font-color2: var(\n",
       "    --jp-content-font-color2,\n",
       "    var(--pst-color-text-base, rgba(0, 0, 0, 0.54))\n",
       "  );\n",
       "  --xr-font-color3: var(\n",
       "    --jp-content-font-color3,\n",
       "    var(--pst-color-text-base, rgba(0, 0, 0, 0.38))\n",
       "  );\n",
       "  --xr-border-color: var(\n",
       "    --jp-border-color2,\n",
       "    hsl(from var(--pst-color-on-background, white) h s calc(l - 10))\n",
       "  );\n",
       "  --xr-disabled-color: var(\n",
       "    --jp-layout-color3,\n",
       "    hsl(from var(--pst-color-on-background, white) h s calc(l - 40))\n",
       "  );\n",
       "  --xr-background-color: var(\n",
       "    --jp-layout-color0,\n",
       "    var(--pst-color-on-background, white)\n",
       "  );\n",
       "  --xr-background-color-row-even: var(\n",
       "    --jp-layout-color1,\n",
       "    hsl(from var(--pst-color-on-background, white) h s calc(l - 5))\n",
       "  );\n",
       "  --xr-background-color-row-odd: var(\n",
       "    --jp-layout-color2,\n",
       "    hsl(from var(--pst-color-on-background, white) h s calc(l - 15))\n",
       "  );\n",
       "}\n",
       "\n",
       "html[theme=\"dark\"],\n",
       "html[data-theme=\"dark\"],\n",
       "body[data-theme=\"dark\"],\n",
       "body.vscode-dark {\n",
       "  --xr-font-color0: var(\n",
       "    --jp-content-font-color0,\n",
       "    var(--pst-color-text-base, rgba(255, 255, 255, 1))\n",
       "  );\n",
       "  --xr-font-color2: var(\n",
       "    --jp-content-font-color2,\n",
       "    var(--pst-color-text-base, rgba(255, 255, 255, 0.54))\n",
       "  );\n",
       "  --xr-font-color3: var(\n",
       "    --jp-content-font-color3,\n",
       "    var(--pst-color-text-base, rgba(255, 255, 255, 0.38))\n",
       "  );\n",
       "  --xr-border-color: var(\n",
       "    --jp-border-color2,\n",
       "    hsl(from var(--pst-color-on-background, #111111) h s calc(l + 10))\n",
       "  );\n",
       "  --xr-disabled-color: var(\n",
       "    --jp-layout-color3,\n",
       "    hsl(from var(--pst-color-on-background, #111111) h s calc(l + 40))\n",
       "  );\n",
       "  --xr-background-color: var(\n",
       "    --jp-layout-color0,\n",
       "    var(--pst-color-on-background, #111111)\n",
       "  );\n",
       "  --xr-background-color-row-even: var(\n",
       "    --jp-layout-color1,\n",
       "    hsl(from var(--pst-color-on-background, #111111) h s calc(l + 5))\n",
       "  );\n",
       "  --xr-background-color-row-odd: var(\n",
       "    --jp-layout-color2,\n",
       "    hsl(from var(--pst-color-on-background, #111111) h s calc(l + 15))\n",
       "  );\n",
       "}\n",
       "\n",
       ".xr-wrap {\n",
       "  display: block !important;\n",
       "  min-width: 300px;\n",
       "  max-width: 700px;\n",
       "}\n",
       "\n",
       ".xr-text-repr-fallback {\n",
       "  /* fallback to plain text repr when CSS is not injected (untrusted notebook) */\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-header {\n",
       "  padding-top: 6px;\n",
       "  padding-bottom: 6px;\n",
       "  margin-bottom: 4px;\n",
       "  border-bottom: solid 1px var(--xr-border-color);\n",
       "}\n",
       "\n",
       ".xr-header > div,\n",
       ".xr-header > ul {\n",
       "  display: inline;\n",
       "  margin-top: 0;\n",
       "  margin-bottom: 0;\n",
       "}\n",
       "\n",
       ".xr-obj-type,\n",
       ".xr-array-name {\n",
       "  margin-left: 2px;\n",
       "  margin-right: 10px;\n",
       "}\n",
       "\n",
       ".xr-obj-type {\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-sections {\n",
       "  padding-left: 0 !important;\n",
       "  display: grid;\n",
       "  grid-template-columns: 150px auto auto 1fr 0 20px 0 20px;\n",
       "}\n",
       "\n",
       ".xr-section-item {\n",
       "  display: contents;\n",
       "}\n",
       "\n",
       ".xr-section-item input {\n",
       "  display: inline-block;\n",
       "  opacity: 0;\n",
       "  height: 0;\n",
       "}\n",
       "\n",
       ".xr-section-item input + label {\n",
       "  color: var(--xr-disabled-color);\n",
       "  border: 2px solid transparent !important;\n",
       "}\n",
       "\n",
       ".xr-section-item input:enabled + label {\n",
       "  cursor: pointer;\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-section-item input:focus + label {\n",
       "  border: 2px solid var(--xr-font-color0) !important;\n",
       "}\n",
       "\n",
       ".xr-section-item input:enabled + label:hover {\n",
       "  color: var(--xr-font-color0);\n",
       "}\n",
       "\n",
       ".xr-section-summary {\n",
       "  grid-column: 1;\n",
       "  color: var(--xr-font-color2);\n",
       "  font-weight: 500;\n",
       "}\n",
       "\n",
       ".xr-section-summary > span {\n",
       "  display: inline-block;\n",
       "  padding-left: 0.5em;\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:disabled + label {\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-section-summary-in + label:before {\n",
       "  display: inline-block;\n",
       "  content: \"►\";\n",
       "  font-size: 11px;\n",
       "  width: 15px;\n",
       "  text-align: center;\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:disabled + label:before {\n",
       "  color: var(--xr-disabled-color);\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:checked + label:before {\n",
       "  content: \"▼\";\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:checked + label > span {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-section-summary,\n",
       ".xr-section-inline-details {\n",
       "  padding-top: 4px;\n",
       "  padding-bottom: 4px;\n",
       "}\n",
       "\n",
       ".xr-section-inline-details {\n",
       "  grid-column: 2 / -1;\n",
       "}\n",
       "\n",
       ".xr-section-details {\n",
       "  display: none;\n",
       "  grid-column: 1 / -1;\n",
       "  margin-bottom: 5px;\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:checked ~ .xr-section-details {\n",
       "  display: contents;\n",
       "}\n",
       "\n",
       ".xr-array-wrap {\n",
       "  grid-column: 1 / -1;\n",
       "  display: grid;\n",
       "  grid-template-columns: 20px auto;\n",
       "}\n",
       "\n",
       ".xr-array-wrap > label {\n",
       "  grid-column: 1;\n",
       "  vertical-align: top;\n",
       "}\n",
       "\n",
       ".xr-preview {\n",
       "  color: var(--xr-font-color3);\n",
       "}\n",
       "\n",
       ".xr-array-preview,\n",
       ".xr-array-data {\n",
       "  padding: 0 5px !important;\n",
       "  grid-column: 2;\n",
       "}\n",
       "\n",
       ".xr-array-data,\n",
       ".xr-array-in:checked ~ .xr-array-preview {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-array-in:checked ~ .xr-array-data,\n",
       ".xr-array-preview {\n",
       "  display: inline-block;\n",
       "}\n",
       "\n",
       ".xr-dim-list {\n",
       "  display: inline-block !important;\n",
       "  list-style: none;\n",
       "  padding: 0 !important;\n",
       "  margin: 0;\n",
       "}\n",
       "\n",
       ".xr-dim-list li {\n",
       "  display: inline-block;\n",
       "  padding: 0;\n",
       "  margin: 0;\n",
       "}\n",
       "\n",
       ".xr-dim-list:before {\n",
       "  content: \"(\";\n",
       "}\n",
       "\n",
       ".xr-dim-list:after {\n",
       "  content: \")\";\n",
       "}\n",
       "\n",
       ".xr-dim-list li:not(:last-child):after {\n",
       "  content: \",\";\n",
       "  padding-right: 5px;\n",
       "}\n",
       "\n",
       ".xr-has-index {\n",
       "  font-weight: bold;\n",
       "}\n",
       "\n",
       ".xr-var-list,\n",
       ".xr-var-item {\n",
       "  display: contents;\n",
       "}\n",
       "\n",
       ".xr-var-item > div,\n",
       ".xr-var-item label,\n",
       ".xr-var-item > .xr-var-name span {\n",
       "  background-color: var(--xr-background-color-row-even);\n",
       "  border-color: var(--xr-background-color-row-odd);\n",
       "  margin-bottom: 0;\n",
       "  padding-top: 2px;\n",
       "}\n",
       "\n",
       ".xr-var-item > .xr-var-name:hover span {\n",
       "  padding-right: 5px;\n",
       "}\n",
       "\n",
       ".xr-var-list > li:nth-child(odd) > div,\n",
       ".xr-var-list > li:nth-child(odd) > label,\n",
       ".xr-var-list > li:nth-child(odd) > .xr-var-name span {\n",
       "  background-color: var(--xr-background-color-row-odd);\n",
       "  border-color: var(--xr-background-color-row-even);\n",
       "}\n",
       "\n",
       ".xr-var-name {\n",
       "  grid-column: 1;\n",
       "}\n",
       "\n",
       ".xr-var-dims {\n",
       "  grid-column: 2;\n",
       "}\n",
       "\n",
       ".xr-var-dtype {\n",
       "  grid-column: 3;\n",
       "  text-align: right;\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-var-preview {\n",
       "  grid-column: 4;\n",
       "}\n",
       "\n",
       ".xr-index-preview {\n",
       "  grid-column: 2 / 5;\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-var-name,\n",
       ".xr-var-dims,\n",
       ".xr-var-dtype,\n",
       ".xr-preview,\n",
       ".xr-attrs dt {\n",
       "  white-space: nowrap;\n",
       "  overflow: hidden;\n",
       "  text-overflow: ellipsis;\n",
       "  padding-right: 10px;\n",
       "}\n",
       "\n",
       ".xr-var-name:hover,\n",
       ".xr-var-dims:hover,\n",
       ".xr-var-dtype:hover,\n",
       ".xr-attrs dt:hover {\n",
       "  overflow: visible;\n",
       "  width: auto;\n",
       "  z-index: 1;\n",
       "}\n",
       "\n",
       ".xr-var-attrs,\n",
       ".xr-var-data,\n",
       ".xr-index-data {\n",
       "  display: none;\n",
       "  border-top: 2px dotted var(--xr-background-color);\n",
       "  padding-bottom: 20px !important;\n",
       "  padding-top: 10px !important;\n",
       "}\n",
       "\n",
       ".xr-var-attrs-in + label,\n",
       ".xr-var-data-in + label,\n",
       ".xr-index-data-in + label {\n",
       "  padding: 0 1px;\n",
       "}\n",
       "\n",
       ".xr-var-attrs-in:checked ~ .xr-var-attrs,\n",
       ".xr-var-data-in:checked ~ .xr-var-data,\n",
       ".xr-index-data-in:checked ~ .xr-index-data {\n",
       "  display: block;\n",
       "}\n",
       "\n",
       ".xr-var-data > table {\n",
       "  float: right;\n",
       "}\n",
       "\n",
       ".xr-var-data > pre,\n",
       ".xr-index-data > pre,\n",
       ".xr-var-data > table > tbody > tr {\n",
       "  background-color: transparent !important;\n",
       "}\n",
       "\n",
       ".xr-var-name span,\n",
       ".xr-var-data,\n",
       ".xr-index-name div,\n",
       ".xr-index-data,\n",
       ".xr-attrs {\n",
       "  padding-left: 25px !important;\n",
       "}\n",
       "\n",
       ".xr-attrs,\n",
       ".xr-var-attrs,\n",
       ".xr-var-data,\n",
       ".xr-index-data {\n",
       "  grid-column: 1 / -1;\n",
       "}\n",
       "\n",
       "dl.xr-attrs {\n",
       "  padding: 0;\n",
       "  margin: 0;\n",
       "  display: grid;\n",
       "  grid-template-columns: 125px auto;\n",
       "}\n",
       "\n",
       ".xr-attrs dt,\n",
       ".xr-attrs dd {\n",
       "  padding: 0;\n",
       "  margin: 0;\n",
       "  float: left;\n",
       "  padding-right: 10px;\n",
       "  width: auto;\n",
       "}\n",
       "\n",
       ".xr-attrs dt {\n",
       "  font-weight: normal;\n",
       "  grid-column: 1;\n",
       "}\n",
       "\n",
       ".xr-attrs dt:hover span {\n",
       "  display: inline-block;\n",
       "  background: var(--xr-background-color);\n",
       "  padding-right: 10px;\n",
       "}\n",
       "\n",
       ".xr-attrs dd {\n",
       "  grid-column: 2;\n",
       "  white-space: pre-wrap;\n",
       "  word-break: break-all;\n",
       "}\n",
       "\n",
       ".xr-icon-database,\n",
       ".xr-icon-file-text2,\n",
       ".xr-no-icon {\n",
       "  display: inline-block;\n",
       "  vertical-align: middle;\n",
       "  width: 1em;\n",
       "  height: 1.5em !important;\n",
       "  stroke-width: 0;\n",
       "  stroke: currentColor;\n",
       "  fill: currentColor;\n",
       "}\n",
       "\n",
       ".xr-var-attrs-in:checked + label > .xr-icon-file-text2,\n",
       ".xr-var-data-in:checked + label > .xr-icon-database,\n",
       ".xr-index-data-in:checked + label > .xr-icon-database {\n",
       "  color: var(--xr-font-color0);\n",
       "  filter: drop-shadow(1px 1px 5px var(--xr-font-color2));\n",
       "  stroke-width: 0.8px;\n",
       "}\n",
       "</style><pre class='xr-text-repr-fallback'>&lt;xarray.Dataset&gt; Size: 4kB\n",
       "Dimensions:  (__obs__: 250)\n",
       "Coordinates:\n",
       "  * __obs__  (__obs__) int64 2kB 0 1 2 3 4 5 6 7 ... 243 244 245 246 247 248 249\n",
       "Data variables:\n",
       "    count    (__obs__) int64 2kB 0 0 0 0 1 0 0 0 0 1 0 ... 4 1 1 0 1 0 0 0 0 0 0\n",
       "Attributes:\n",
       "    created_at:                  2025-09-28T17:53:04.359378+00:00\n",
       "    arviz_version:               0.22.0\n",
       "    inference_library:           pymc\n",
       "    inference_library_version:   3.9.2+2907.g7a3db78e6\n",
       "    modeling_interface:          bambi\n",
       "    modeling_interface_version:  0.14.1.dev57+g7b2bb342c.d20250928</pre><div class='xr-wrap' style='display:none'><div class='xr-header'><div class='xr-obj-type'>xarray.Dataset</div></div><ul class='xr-sections'><li class='xr-section-item'><input id='section-5f9eaa5c-058a-4337-839e-c808c8bffe48' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-5f9eaa5c-058a-4337-839e-c808c8bffe48' class='xr-section-summary'  title='Expand/collapse section'>Dimensions:</label><div class='xr-section-inline-details'><ul class='xr-dim-list'><li><span class='xr-has-index'>__obs__</span>: 250</li></ul></div><div class='xr-section-details'></div></li><li class='xr-section-item'><input id='section-f9677aac-d15f-405c-b1ac-d7ab05c648a0' class='xr-section-summary-in' type='checkbox'  checked><label for='section-f9677aac-d15f-405c-b1ac-d7ab05c648a0' class='xr-section-summary' >Coordinates: <span>(1)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>__obs__</span></div><div class='xr-var-dims'>(__obs__)</div><div class='xr-var-dtype'>int64</div><div class='xr-var-preview xr-preview'>0 1 2 3 4 5 ... 245 246 247 248 249</div><input id='attrs-3a4c3ae4-04ed-4c0f-ab5c-54d95054d9fa' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-3a4c3ae4-04ed-4c0f-ab5c-54d95054d9fa' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-ce888e20-f213-49eb-a9b6-6511c93c53df' class='xr-var-data-in' type='checkbox'><label for='data-ce888e20-f213-49eb-a9b6-6511c93c53df' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([  0,   1,   2, ..., 247, 248, 249], shape=(250,))</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-bb8e6075-5b13-4c16-b29e-09fe9acf3acf' class='xr-section-summary-in' type='checkbox'  checked><label for='section-bb8e6075-5b13-4c16-b29e-09fe9acf3acf' class='xr-section-summary' >Data variables: <span>(1)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-var-name'><span>count</span></div><div class='xr-var-dims'>(__obs__)</div><div class='xr-var-dtype'>int64</div><div class='xr-var-preview xr-preview'>0 0 0 0 1 0 0 0 ... 0 1 0 0 0 0 0 0</div><input id='attrs-286b44d1-8283-4062-937e-938a12a4328d' class='xr-var-attrs-in' type='checkbox' disabled><label for='attrs-286b44d1-8283-4062-937e-938a12a4328d' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-1adfd68b-a19c-4acf-97e8-d7980e9aadf2' class='xr-var-data-in' type='checkbox'><label for='data-1adfd68b-a19c-4acf-97e8-d7980e9aadf2' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'></dl></div><div class='xr-var-data'><pre>array([  0,   0,   0,   0,   1,   0,   0,   0,   0,   1,   0,   0,   1,\n",
       "         2,   0,   1,   0,   0,   1,   0,   1,   5,   0,   3,  30,   0,\n",
       "        13,   0,   0,   0,   0,   0,  11,   5,   0,   1,   1,   7,   0,\n",
       "        14,   0,  32,   0,   1,   0,   0,   0,   1,   5,   0,   1,   0,\n",
       "        22,   0,  15,   0,   0,   0,   5,   4,   2,   0,   2,  32,   0,\n",
       "         0,   1,   0,   0,   0,   7,   0,   0,   0,   0,   0,   0,   0,\n",
       "         0,   2,   3,   1,   5,   0,   2,   1,   0,   1, 149,   0,   1,\n",
       "         0,   0,   1,   0,   0,   0,   2,   2,  29,   3,   0,   0,   5,\n",
       "         0,   0,   0,   0,   0,   1,   7,   1,   0,   2,   0,   2,   0,\n",
       "         0,   0,   1,   0,   0,   0,   0,   0,   3,   4,   3,   3,   8,\n",
       "         2,   1,   6,   0,   0,   5,   3,  31,   0,   2,   0,   0,   0,\n",
       "         0,   0,   0,   6,   9,   0,   0,   0,   0,   0,   2,  15,   1,\n",
       "         2,   3,   0,  65,   5,   0,   0,   0,   0,   1,   8,   0,   0,\n",
       "         0,   2,   4,   5,   9,   0,   0,   0,   0,  21,   0,   6,   0,\n",
       "         0,   0,   0,  16,   0,   0,   4,   2,  10,   0,   0,   0,   2,\n",
       "         1,   3,   0,   0,  21,   0,   0,   2,   0,   3,   0,  38,   0,\n",
       "         0,   0,   1,   3,   0,   1,   0,   0,   0,   0,   5,   0,   0,\n",
       "         2,   0,   0,   0,   1,   4,   0,   0,   2,   3,   0,   0,   0,\n",
       "         0,   1,   2,   0,   6,   4,   1,   1,   0,   1,   0,   0,   0,\n",
       "         0,   0,   0])</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-1f9df92d-ec69-4c64-9748-cae2a60f9771' class='xr-section-summary-in' type='checkbox'  ><label for='section-1f9df92d-ec69-4c64-9748-cae2a60f9771' class='xr-section-summary' >Indexes: <span>(1)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-index-name'><div>__obs__</div></div><div class='xr-index-preview'>PandasIndex</div><input type='checkbox' disabled/><label></label><input id='index-41dcdd09-551c-459a-9c94-8b9659906f75' class='xr-index-data-in' type='checkbox'/><label for='index-41dcdd09-551c-459a-9c94-8b9659906f75' title='Show/Hide index repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-index-data'><pre>PandasIndex(Index([  0,   1,   2,   3,   4,   5,   6,   7,   8,   9,\n",
       "       ...\n",
       "       240, 241, 242, 243, 244, 245, 246, 247, 248, 249],\n",
       "      dtype=&#x27;int64&#x27;, name=&#x27;__obs__&#x27;, length=250))</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-6ec4d9cb-2683-4d25-a205-0514c7c01707' class='xr-section-summary-in' type='checkbox'  checked><label for='section-6ec4d9cb-2683-4d25-a205-0514c7c01707' class='xr-section-summary' >Attributes: <span>(6)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><dl class='xr-attrs'><dt><span>created_at :</span></dt><dd>2025-09-28T17:53:04.359378+00:00</dd><dt><span>arviz_version :</span></dt><dd>0.22.0</dd><dt><span>inference_library :</span></dt><dd>pymc</dd><dt><span>inference_library_version :</span></dt><dd>3.9.2+2907.g7a3db78e6</dd><dt><span>modeling_interface :</span></dt><dd>bambi</dd><dt><span>modeling_interface_version :</span></dt><dd>0.14.1.dev57+g7b2bb342c.d20250928</dd></dl></div></li></ul></div></div><br></div>\n",
       "                      </ul>\n",
       "                  </div>\n",
       "            </li>\n",
       "            \n",
       "              </ul>\n",
       "            </div>\n",
       "            <style> /* CSS stylesheet for displaying InferenceData objects in jupyterlab.\n",
       " *\n",
       " */\n",
       "\n",
       ":root {\n",
       "  --xr-font-color0: var(--jp-content-font-color0, rgba(0, 0, 0, 1));\n",
       "  --xr-font-color2: var(--jp-content-font-color2, rgba(0, 0, 0, 0.54));\n",
       "  --xr-font-color3: var(--jp-content-font-color3, rgba(0, 0, 0, 0.38));\n",
       "  --xr-border-color: var(--jp-border-color2, #e0e0e0);\n",
       "  --xr-disabled-color: var(--jp-layout-color3, #bdbdbd);\n",
       "  --xr-background-color: var(--jp-layout-color0, white);\n",
       "  --xr-background-color-row-even: var(--jp-layout-color1, white);\n",
       "  --xr-background-color-row-odd: var(--jp-layout-color2, #eeeeee);\n",
       "}\n",
       "\n",
       "html[theme=dark],\n",
       "body.vscode-dark {\n",
       "  --xr-font-color0: rgba(255, 255, 255, 1);\n",
       "  --xr-font-color2: rgba(255, 255, 255, 0.54);\n",
       "  --xr-font-color3: rgba(255, 255, 255, 0.38);\n",
       "  --xr-border-color: #1F1F1F;\n",
       "  --xr-disabled-color: #515151;\n",
       "  --xr-background-color: #111111;\n",
       "  --xr-background-color-row-even: #111111;\n",
       "  --xr-background-color-row-odd: #313131;\n",
       "}\n",
       "\n",
       ".xr-wrap {\n",
       "  display: block;\n",
       "  min-width: 300px;\n",
       "  max-width: 700px;\n",
       "}\n",
       "\n",
       ".xr-text-repr-fallback {\n",
       "  /* fallback to plain text repr when CSS is not injected (untrusted notebook) */\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-header {\n",
       "  padding-top: 6px;\n",
       "  padding-bottom: 6px;\n",
       "  margin-bottom: 4px;\n",
       "  border-bottom: solid 1px var(--xr-border-color);\n",
       "}\n",
       "\n",
       ".xr-header > div,\n",
       ".xr-header > ul {\n",
       "  display: inline;\n",
       "  margin-top: 0;\n",
       "  margin-bottom: 0;\n",
       "}\n",
       "\n",
       ".xr-obj-type,\n",
       ".xr-array-name {\n",
       "  margin-left: 2px;\n",
       "  margin-right: 10px;\n",
       "}\n",
       "\n",
       ".xr-obj-type {\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-sections {\n",
       "  padding-left: 0 !important;\n",
       "  display: grid;\n",
       "  grid-template-columns: 150px auto auto 1fr 20px 20px;\n",
       "}\n",
       "\n",
       ".xr-sections.group-sections {\n",
       "  grid-template-columns: auto;\n",
       "}\n",
       "\n",
       ".xr-section-item {\n",
       "  display: contents;\n",
       "}\n",
       "\n",
       ".xr-section-item input {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-section-item input + label {\n",
       "  color: var(--xr-disabled-color);\n",
       "}\n",
       "\n",
       ".xr-section-item input:enabled + label {\n",
       "  cursor: pointer;\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-section-item input:enabled + label:hover {\n",
       "  color: var(--xr-font-color0);\n",
       "}\n",
       "\n",
       ".xr-section-summary {\n",
       "  grid-column: 1;\n",
       "  color: var(--xr-font-color2);\n",
       "  font-weight: 500;\n",
       "}\n",
       "\n",
       ".xr-section-summary > span {\n",
       "  display: inline-block;\n",
       "  padding-left: 0.5em;\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:disabled + label {\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-section-summary-in + label:before {\n",
       "  display: inline-block;\n",
       "  content: '►';\n",
       "  font-size: 11px;\n",
       "  width: 15px;\n",
       "  text-align: center;\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:disabled + label:before {\n",
       "  color: var(--xr-disabled-color);\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:checked + label:before {\n",
       "  content: '▼';\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:checked + label > span {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-section-summary,\n",
       ".xr-section-inline-details {\n",
       "  padding-top: 4px;\n",
       "  padding-bottom: 4px;\n",
       "}\n",
       "\n",
       ".xr-section-inline-details {\n",
       "  grid-column: 2 / -1;\n",
       "}\n",
       "\n",
       ".xr-section-details {\n",
       "  display: none;\n",
       "  grid-column: 1 / -1;\n",
       "  margin-bottom: 5px;\n",
       "}\n",
       "\n",
       ".xr-section-summary-in:checked ~ .xr-section-details {\n",
       "  display: contents;\n",
       "}\n",
       "\n",
       ".xr-array-wrap {\n",
       "  grid-column: 1 / -1;\n",
       "  display: grid;\n",
       "  grid-template-columns: 20px auto;\n",
       "}\n",
       "\n",
       ".xr-array-wrap > label {\n",
       "  grid-column: 1;\n",
       "  vertical-align: top;\n",
       "}\n",
       "\n",
       ".xr-preview {\n",
       "  color: var(--xr-font-color3);\n",
       "}\n",
       "\n",
       ".xr-array-preview,\n",
       ".xr-array-data {\n",
       "  padding: 0 5px !important;\n",
       "  grid-column: 2;\n",
       "}\n",
       "\n",
       ".xr-array-data,\n",
       ".xr-array-in:checked ~ .xr-array-preview {\n",
       "  display: none;\n",
       "}\n",
       "\n",
       ".xr-array-in:checked ~ .xr-array-data,\n",
       ".xr-array-preview {\n",
       "  display: inline-block;\n",
       "}\n",
       "\n",
       ".xr-dim-list {\n",
       "  display: inline-block !important;\n",
       "  list-style: none;\n",
       "  padding: 0 !important;\n",
       "  margin: 0;\n",
       "}\n",
       "\n",
       ".xr-dim-list li {\n",
       "  display: inline-block;\n",
       "  padding: 0;\n",
       "  margin: 0;\n",
       "}\n",
       "\n",
       ".xr-dim-list:before {\n",
       "  content: '(';\n",
       "}\n",
       "\n",
       ".xr-dim-list:after {\n",
       "  content: ')';\n",
       "}\n",
       "\n",
       ".xr-dim-list li:not(:last-child):after {\n",
       "  content: ',';\n",
       "  padding-right: 5px;\n",
       "}\n",
       "\n",
       ".xr-has-index {\n",
       "  font-weight: bold;\n",
       "}\n",
       "\n",
       ".xr-var-list,\n",
       ".xr-var-item {\n",
       "  display: contents;\n",
       "}\n",
       "\n",
       ".xr-var-item > div,\n",
       ".xr-var-item label,\n",
       ".xr-var-item > .xr-var-name span {\n",
       "  background-color: var(--xr-background-color-row-even);\n",
       "  margin-bottom: 0;\n",
       "}\n",
       "\n",
       ".xr-var-item > .xr-var-name:hover span {\n",
       "  padding-right: 5px;\n",
       "}\n",
       "\n",
       ".xr-var-list > li:nth-child(odd) > div,\n",
       ".xr-var-list > li:nth-child(odd) > label,\n",
       ".xr-var-list > li:nth-child(odd) > .xr-var-name span {\n",
       "  background-color: var(--xr-background-color-row-odd);\n",
       "}\n",
       "\n",
       ".xr-var-name {\n",
       "  grid-column: 1;\n",
       "}\n",
       "\n",
       ".xr-var-dims {\n",
       "  grid-column: 2;\n",
       "}\n",
       "\n",
       ".xr-var-dtype {\n",
       "  grid-column: 3;\n",
       "  text-align: right;\n",
       "  color: var(--xr-font-color2);\n",
       "}\n",
       "\n",
       ".xr-var-preview {\n",
       "  grid-column: 4;\n",
       "}\n",
       "\n",
       ".xr-var-name,\n",
       ".xr-var-dims,\n",
       ".xr-var-dtype,\n",
       ".xr-preview,\n",
       ".xr-attrs dt {\n",
       "  white-space: nowrap;\n",
       "  overflow: hidden;\n",
       "  text-overflow: ellipsis;\n",
       "  padding-right: 10px;\n",
       "}\n",
       "\n",
       ".xr-var-name:hover,\n",
       ".xr-var-dims:hover,\n",
       ".xr-var-dtype:hover,\n",
       ".xr-attrs dt:hover {\n",
       "  overflow: visible;\n",
       "  width: auto;\n",
       "  z-index: 1;\n",
       "}\n",
       "\n",
       ".xr-var-attrs,\n",
       ".xr-var-data {\n",
       "  display: none;\n",
       "  background-color: var(--xr-background-color) !important;\n",
       "  padding-bottom: 5px !important;\n",
       "}\n",
       "\n",
       ".xr-var-attrs-in:checked ~ .xr-var-attrs,\n",
       ".xr-var-data-in:checked ~ .xr-var-data {\n",
       "  display: block;\n",
       "}\n",
       "\n",
       ".xr-var-data > table {\n",
       "  float: right;\n",
       "}\n",
       "\n",
       ".xr-var-name span,\n",
       ".xr-var-data,\n",
       ".xr-attrs {\n",
       "  padding-left: 25px !important;\n",
       "}\n",
       "\n",
       ".xr-attrs,\n",
       ".xr-var-attrs,\n",
       ".xr-var-data {\n",
       "  grid-column: 1 / -1;\n",
       "}\n",
       "\n",
       "dl.xr-attrs {\n",
       "  padding: 0;\n",
       "  margin: 0;\n",
       "  display: grid;\n",
       "  grid-template-columns: 125px auto;\n",
       "}\n",
       "\n",
       ".xr-attrs dt,\n",
       ".xr-attrs dd {\n",
       "  padding: 0;\n",
       "  margin: 0;\n",
       "  float: left;\n",
       "  padding-right: 10px;\n",
       "  width: auto;\n",
       "}\n",
       "\n",
       ".xr-attrs dt {\n",
       "  font-weight: normal;\n",
       "  grid-column: 1;\n",
       "}\n",
       "\n",
       ".xr-attrs dt:hover span {\n",
       "  display: inline-block;\n",
       "  background: var(--xr-background-color);\n",
       "  padding-right: 10px;\n",
       "}\n",
       "\n",
       ".xr-attrs dd {\n",
       "  grid-column: 2;\n",
       "  white-space: pre-wrap;\n",
       "  word-break: break-all;\n",
       "}\n",
       "\n",
       ".xr-icon-database,\n",
       ".xr-icon-file-text2 {\n",
       "  display: inline-block;\n",
       "  vertical-align: middle;\n",
       "  width: 1em;\n",
       "  height: 1.5em !important;\n",
       "  stroke-width: 0;\n",
       "  stroke: currentColor;\n",
       "  fill: currentColor;\n",
       "}\n",
       ".xr-wrap{width:700px!important;} </style>"
      ],
      "text/plain": [
       "Inference data with groups:\n",
       "\t> posterior\n",
       "\t> sample_stats\n",
       "\t> observed_data"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "idata_grid"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "draw_1 = select_draws(idata_grid, grid, {\"livebait\": 0}, \"mu\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>mean</th>\n",
       "      <th>hdi_low</th>\n",
       "      <th>hdi_high</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0.213995</td>\n",
       "      <td>0.143976</td>\n",
       "      <td>0.286619</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0.053701</td>\n",
       "      <td>0.031074</td>\n",
       "      <td>0.079068</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0.013598</td>\n",
       "      <td>0.006305</td>\n",
       "      <td>0.022216</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0.003475</td>\n",
       "      <td>0.001268</td>\n",
       "      <td>0.006288</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0.511683</td>\n",
       "      <td>0.373739</td>\n",
       "      <td>0.667900</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>0.128343</td>\n",
       "      <td>0.078841</td>\n",
       "      <td>0.183933</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>0.032483</td>\n",
       "      <td>0.015540</td>\n",
       "      <td>0.051750</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>0.008296</td>\n",
       "      <td>0.003144</td>\n",
       "      <td>0.014865</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>1.225939</td>\n",
       "      <td>0.921290</td>\n",
       "      <td>1.553605</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>0.307349</td>\n",
       "      <td>0.194784</td>\n",
       "      <td>0.436108</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       mean   hdi_low  hdi_high\n",
       "0  0.213995  0.143976  0.286619\n",
       "1  0.053701  0.031074  0.079068\n",
       "2  0.013598  0.006305  0.022216\n",
       "3  0.003475  0.001268  0.006288\n",
       "4  0.511683  0.373739  0.667900\n",
       "5  0.128343  0.078841  0.183933\n",
       "6  0.032483  0.015540  0.051750\n",
       "7  0.008296  0.003144  0.014865\n",
       "8  1.225939  0.921290  1.553605\n",
       "9  0.307349  0.194784  0.436108"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "draw_1 = select_draws(idata_grid, grid, {\"livebait\": 0}, \"mu\")\n",
    "draw_2 = select_draws(idata_grid, grid, {\"livebait\": 1}, \"mu\")\n",
    "\n",
    "comparison_mean = (draw_2 - draw_1).mean((\"chain\", \"draw\"))\n",
    "comparison_hdi = az.hdi(draw_2 - draw_1)\n",
    "\n",
    "comparison_df = pd.DataFrame(\n",
    "    {\n",
    "        \"mean\": comparison_mean.values,\n",
    "        \"hdi_low\": comparison_hdi.sel(hdi=\"lower\")[\"mu\"].values,\n",
    "        \"hdi_high\": comparison_hdi.sel(hdi=\"higher\")[\"mu\"].values,\n",
    "    }\n",
    ")\n",
    "comparison_df.head(10)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We can compare this comparison with `bmb.interpret.comparisons`."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>term</th>\n",
       "      <th>estimate_type</th>\n",
       "      <th>value</th>\n",
       "      <th>camper</th>\n",
       "      <th>persons</th>\n",
       "      <th>child</th>\n",
       "      <th>estimate</th>\n",
       "      <th>lower_3.0%</th>\n",
       "      <th>upper_97.0%</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>livebait</td>\n",
       "      <td>diff</td>\n",
       "      <td>(0, 1)</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0.213995</td>\n",
       "      <td>0.143976</td>\n",
       "      <td>0.286619</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>livebait</td>\n",
       "      <td>diff</td>\n",
       "      <td>(0, 1)</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>0.053701</td>\n",
       "      <td>0.031074</td>\n",
       "      <td>0.079068</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>livebait</td>\n",
       "      <td>diff</td>\n",
       "      <td>(0, 1)</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>0.013598</td>\n",
       "      <td>0.006305</td>\n",
       "      <td>0.022216</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>livebait</td>\n",
       "      <td>diff</td>\n",
       "      <td>(0, 1)</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>4</td>\n",
       "      <td>0.003475</td>\n",
       "      <td>0.001268</td>\n",
       "      <td>0.006288</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>livebait</td>\n",
       "      <td>diff</td>\n",
       "      <td>(0, 1)</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>0.511683</td>\n",
       "      <td>0.373739</td>\n",
       "      <td>0.667900</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>livebait</td>\n",
       "      <td>diff</td>\n",
       "      <td>(0, 1)</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>0.128343</td>\n",
       "      <td>0.078841</td>\n",
       "      <td>0.183933</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>livebait</td>\n",
       "      <td>diff</td>\n",
       "      <td>(0, 1)</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>0.032483</td>\n",
       "      <td>0.015540</td>\n",
       "      <td>0.051750</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>livebait</td>\n",
       "      <td>diff</td>\n",
       "      <td>(0, 1)</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>4</td>\n",
       "      <td>0.008296</td>\n",
       "      <td>0.003144</td>\n",
       "      <td>0.014865</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>livebait</td>\n",
       "      <td>diff</td>\n",
       "      <td>(0, 1)</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>1.225939</td>\n",
       "      <td>0.921290</td>\n",
       "      <td>1.553605</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>livebait</td>\n",
       "      <td>diff</td>\n",
       "      <td>(0, 1)</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>2</td>\n",
       "      <td>0.307349</td>\n",
       "      <td>0.194784</td>\n",
       "      <td>0.436108</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       term estimate_type   value camper  persons  child  estimate  \\\n",
       "0  livebait          diff  (0, 1)      0        1      1  0.213995   \n",
       "1  livebait          diff  (0, 1)      0        1      2  0.053701   \n",
       "2  livebait          diff  (0, 1)      0        1      3  0.013598   \n",
       "3  livebait          diff  (0, 1)      0        1      4  0.003475   \n",
       "4  livebait          diff  (0, 1)      0        2      1  0.511683   \n",
       "5  livebait          diff  (0, 1)      0        2      2  0.128343   \n",
       "6  livebait          diff  (0, 1)      0        2      3  0.032483   \n",
       "7  livebait          diff  (0, 1)      0        2      4  0.008296   \n",
       "8  livebait          diff  (0, 1)      0        3      1  1.225939   \n",
       "9  livebait          diff  (0, 1)      0        3      2  0.307349   \n",
       "\n",
       "   lower_3.0%  upper_97.0%  \n",
       "0    0.143976     0.286619  \n",
       "1    0.031074     0.079068  \n",
       "2    0.006305     0.022216  \n",
       "3    0.001268     0.006288  \n",
       "4    0.373739     0.667900  \n",
       "5    0.078841     0.183933  \n",
       "6    0.015540     0.051750  \n",
       "7    0.003144     0.014865  \n",
       "8    0.921290     1.553605  \n",
       "9    0.194784     0.436108  "
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "summary_df = bmb.interpret.comparisons(\n",
    "    fish_model,\n",
    "    fish_idata,\n",
    "    contrast={\"livebait\": [0, 1]},\n",
    "    conditional=conditional\n",
    ")\n",
    "summary_df.head(10)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Albeit the other information in the `summary_df`, the columns `estimate`, `lower_3.0%`, `upper_97.0%` are identical."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Cross comparisons\n",
    "\n",
    "Computing a cross-comparison is useful for when we want to compare contrasts when two (or more) predictors change at the same time. Cross-comparisons are currently not supported in the `comparisons` function, but we can use `select_draws` to compute them. For example, imagine we are interested in computing the cross-comparison between the two rows below."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>term</th>\n",
       "      <th>estimate_type</th>\n",
       "      <th>value</th>\n",
       "      <th>camper</th>\n",
       "      <th>persons</th>\n",
       "      <th>child</th>\n",
       "      <th>estimate</th>\n",
       "      <th>lower_3.0%</th>\n",
       "      <th>upper_97.0%</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>livebait</td>\n",
       "      <td>diff</td>\n",
       "      <td>(0, 1)</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0.213995</td>\n",
       "      <td>0.143976</td>\n",
       "      <td>0.286619</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>livebait</td>\n",
       "      <td>diff</td>\n",
       "      <td>(0, 1)</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>0.053701</td>\n",
       "      <td>0.031074</td>\n",
       "      <td>0.079068</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       term estimate_type   value camper  persons  child  estimate  \\\n",
       "0  livebait          diff  (0, 1)      0        1      1  0.213995   \n",
       "1  livebait          diff  (0, 1)      0        1      2  0.053701   \n",
       "\n",
       "   lower_3.0%  upper_97.0%  \n",
       "0    0.143976     0.286619  \n",
       "1    0.031074     0.079068  "
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "summary_df.iloc[:2]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The cross-comparison amounts to first computing the comparison for row 0, given below, and can be verified by looking at the estimate in `summary_df`."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.21399545475519965"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "cond_10 = {\n",
    "    \"camper\": 0,\n",
    "    \"persons\": 1,\n",
    "    \"child\": 1,\n",
    "    \"livebait\": 0 \n",
    "}\n",
    "\n",
    "cond_11 = {\n",
    "    \"camper\": 0,\n",
    "    \"persons\": 1,\n",
    "    \"child\": 1,\n",
    "    \"livebait\": 1\n",
    "}\n",
    "\n",
    "draws_10 = select_draws(idata_grid, grid, cond_10, \"mu\")\n",
    "draws_11 = select_draws(idata_grid, grid, cond_11, \"mu\")\n",
    "\n",
    "(draws_11 - draws_10).mean((\"chain\", \"draw\")).item()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Next, we need to compute the comparison for row 1."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [],
   "source": [
    "cond_20 = {\n",
    "    \"camper\": 0,\n",
    "    \"persons\": 1,\n",
    "    \"child\": 2,\n",
    "    \"livebait\": 0\n",
    "}\n",
    "\n",
    "cond_21 = {\n",
    "    \"camper\": 0,\n",
    "    \"persons\": 1,\n",
    "    \"child\": 2,\n",
    "    \"livebait\": 1\n",
    "}\n",
    "\n",
    "draws_20 = select_draws(idata_grid, grid, cond_20, \"mu\")\n",
    "draws_21 = select_draws(idata_grid, grid, cond_21, \"mu\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.053701205869420204"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(draws_21 - draws_20).mean((\"chain\", \"draw\")).item()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Next, we compute the \"first level\" comparisons (`diff_1` and `diff_2`). Subsequently, we compute the difference between these two differences to obtain the cross-comparison."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "-0.16029424888577945"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "diff_1 = (draws_11 - draws_10)\n",
    "diff_2 = (draws_21 - draws_20)\n",
    "\n",
    "cross_comparison = (diff_2 - diff_1).mean((\"chain\", \"draw\")).item()\n",
    "cross_comparison"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "To verify this is correct, we can check by performing the cross-comparison directly on the `summary_df`."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "np.float64(-0.16029424888577945)"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "summary_df.iloc[1][\"estimate\"] - summary_df.iloc[0][\"estimate\"]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Summary\n",
    "\n",
    "In this notebook, the interpret helper functions `data_grid` and `select_draws` were introduced and it was demonstrated how they can be used to compute pairwise grids of data and cross-comparisons. With these functions, it is left to the user to generate their grids of data and quantities of interest allowing for more flexibility and control over the type of data passed to `model.predict` and the quantities of interest computed."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Last updated: Sun Sep 28 2025\n",
      "\n",
      "Python implementation: CPython\n",
      "Python version       : 3.13.7\n",
      "IPython version      : 9.4.0\n",
      "\n",
      "numpy : 2.3.3\n",
      "arviz : 0.22.0\n",
      "bambi : 0.14.1.dev57+g7b2bb342c.d20250928\n",
      "pandas: 2.3.2\n",
      "\n",
      "Watermark: 2.5.0\n",
      "\n"
     ]
    }
   ],
   "source": [
    "%load_ext watermark\n",
    "%watermark -n -u -v -iv -w"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "dev",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.13.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
